From 95e18838ca9ba95f96a6cfbb59f5ddf4dd8a40f9 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 15 Nov 2025 17:29:45 +0530 Subject: [PATCH] Sort work centers by name in get_data method of MachineController --- app/Http/Controllers/MachineController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/MachineController.php b/app/Http/Controllers/MachineController.php index 556db7d8f..a7a2b6388 100644 --- a/app/Http/Controllers/MachineController.php +++ b/app/Http/Controllers/MachineController.php @@ -158,7 +158,7 @@ class MachineController extends Controller $test[] = [ 'group_work_center' => WorkGroupMaster::where('id', $curWorkGroupId)->first()->name ?? "", 'operation_number' => WorkGroupMaster::where('id', $curWorkGroupId)->first()->operation_number ?? "", - 'work_centers' => Machine::where('plant_id', $plantId)->where('work_group_master_id', $curWorkGroupId)->pluck('work_center')->toArray() ?? [], + 'work_centers' => Machine::where('plant_id', $plantId)->where('work_group_master_id', $curWorkGroupId)->orderBy('work_center')->pluck('work_center')->toArray() ?? [], ]; }