Unwanted comments removed

This commit is contained in:
dhanabalan
2025-04-06 17:53:56 +05:30
parent 7ada76a733
commit e84a2e87b2

View File

@@ -126,28 +126,11 @@ class ProductionLineStopResource extends Resource
->relationship('shift', 'name') ->relationship('shift', 'name')
->required() ->required()
// ->nullable() // ->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) { ->options(function (callable $get) {
if (!$get('plant_id') || !$get('block_name')) { if (!$get('plant_id') || !$get('block_name')) {
return []; 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')) return Shift::where('plant_id', $get('plant_id'))
->where('block_id', $get('block_name')) ->where('block_id', $get('block_name'))
->pluck('name', 'id') ->pluck('name', 'id')
@@ -187,11 +170,6 @@ class ProductionLineStopResource extends Resource
->relationship('line', 'name') ->relationship('line', 'name')
->required() ->required()
// ->nullable() // ->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) { ->options(function (callable $get) {
if (!$get('plant_id') || !$get('block_name') || !$get('shift_id')) { if (!$get('plant_id') || !$get('block_name') || !$get('shift_id')) {
return []; return [];