From ec6a1271573a511136dd8539d46a82c20932b0a3 Mon Sep 17 00:00:00 2001 From: joddyabott Date: Tue, 2 Sep 2025 15:34:40 +0330 Subject: [PATCH 1/2] fix operator controller for road patrol --- .../Controllers/V3/Dashboard/RoadPatrol/OperatorController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/V3/Dashboard/RoadPatrol/OperatorController.php b/app/Http/Controllers/V3/Dashboard/RoadPatrol/OperatorController.php index 685dd3a8..f3f58721 100644 --- a/app/Http/Controllers/V3/Dashboard/RoadPatrol/OperatorController.php +++ b/app/Http/Controllers/V3/Dashboard/RoadPatrol/OperatorController.php @@ -38,8 +38,10 @@ class OperatorController extends Controller public function store(Mission $mission): JsonResponse { DB::transaction(function () use ($mission) { + $user = auth()->user(); $road_patrol = RoadPatrol::query()->create([ + 'operator_id' => $user->id, 'status' => 0, 'status_fa' => 'در حال بررسی', 'province_id' => $mission->province_id, From 899826a38fcf8b793bc2d93b074b48422df55b2c Mon Sep 17 00:00:00 2001 From: joddyabott Date: Tue, 2 Sep 2025 15:35:25 +0330 Subject: [PATCH 2/2] fix operator controller for road patrol --- app/Services/Cartables/RoadPatrol/OperatorService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Cartables/RoadPatrol/OperatorService.php b/app/Services/Cartables/RoadPatrol/OperatorService.php index ce754c57..2b8b3188 100644 --- a/app/Services/Cartables/RoadPatrol/OperatorService.php +++ b/app/Services/Cartables/RoadPatrol/OperatorService.php @@ -12,8 +12,8 @@ class OperatorService public function dataTable(Request $request, $loadRelations = false) { $query = RoadPatrol::query() - ->where('operator_id', '=', auth()->user()->id) - ->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number'])); + ->where('operator_id', '=', auth()->user()->id); +// ->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number'])); return DataTableFacade::run( $query,