From d827c9368f5ee9ea680234d24ced10e9dfd0f617 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 15 Sep 2025 14:42:26 +0530 Subject: [PATCH] Updated MachineController to replace 'line' with 'workGroupMaster' for accurate data retrieval to get all group and individual work center --- app/Http/Controllers/MachineController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/MachineController.php b/app/Http/Controllers/MachineController.php index d6cd574..5cfb599 100644 --- a/app/Http/Controllers/MachineController.php +++ b/app/Http/Controllers/MachineController.php @@ -41,11 +41,11 @@ class MachineController extends Controller ], 403); } - $machines = Machine::with('plant')->with('line')->orderBy('plant_id')->get(); + $machines = Machine::with('plant')->with('workGroupMaster')->orderBy('plant_id')->get(); $machinesData = $machines->map(function($machine) { return [ 'plant_code' => $machine->plant ? (String)$machine->plant->code : "", - 'group_work_center' => $machine->line->group_work_center ?? "", + 'group_work_center' => $machine->workGroupMaster ? (String)$machine->workGroupMaster->name : "", 'work_center' => $machine->work_center ?? "", ]; });