diff --git a/app/Filament/Resources/ProductionLineStopResource.php b/app/Filament/Resources/ProductionLineStopResource.php index 9e4cb11..396aeb3 100644 --- a/app/Filament/Resources/ProductionLineStopResource.php +++ b/app/Filament/Resources/ProductionLineStopResource.php @@ -126,28 +126,11 @@ class ProductionLineStopResource extends Resource ->relationship('shift', 'name') ->required() // ->nullable() - // ->options(fn (callable $get) => - // \App\Models\Shift::where('plant_id', $get('plant_id')) - // ->pluck('name', 'id') - // ->toArray() // Convert collection to array - // ) ->options(function (callable $get) { if (!$get('plant_id') || !$get('block_name')) { return []; } - // // Get the block ID based on plant_id and block_name - // $block = \App\Models\Block::where('plant_id', $get('plant_id')) - // ->where('name', $get('block_name')) - // ->first(); - // if (!$block) { - // return []; - // } - - // return \App\Models\Shift::where('plant_id', $get('plant_id')) - // ->pluck('name', 'id') - // ->toArray(); - // return \App\Models\Shift::where('plant_id', $get('plant_id')) return Shift::where('plant_id', $get('plant_id')) ->where('block_id', $get('block_name')) ->pluck('name', 'id') @@ -187,11 +170,6 @@ class ProductionLineStopResource extends Resource ->relationship('line', 'name') ->required() // ->nullable() - // ->options(fn (callable $get) => - // \App\Models\Line::where('plant_id', $get('plant_id')) - // ->pluck('name', 'id') - // ->toArray() // Convert collection to array - // ) ->options(function (callable $get) { if (!$get('plant_id') || !$get('block_name') || !$get('shift_id')) { return [];