create transportation unit cartable
This commit is contained in:
34
app/Services/Cartables/Mission/TransportationUnitService.php
Normal file
34
app/Services/Cartables/Mission/TransportationUnitService.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cartables\Mission;
|
||||
|
||||
use App\Exceptions\ProhibitedAction;
|
||||
use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Models\Mission;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TransportationUnitService
|
||||
{
|
||||
public function dataTable(Request $request)
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
$fields = [
|
||||
'id','lat','lon', 'recognize_picture','action_picture','created_at','step', 'final_description',
|
||||
'info_fa', 'activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date',
|
||||
'step_fa', 'axis_type_id', 'axis_type_name', 'action_date', 'is_finished', 'status_fa', 'supervisor_description', 'operator_description'
|
||||
];
|
||||
|
||||
throw_if(is_null($user->edarate_shahri_id), new ProhibitedAction('اداره ای برای شما در سامانه ثبت نشده است!'));
|
||||
|
||||
$query = Mission::query()->where('', '=', '');
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: $fields
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user