Unwanted comments removed
This commit is contained in:
@@ -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 [];
|
||||
|
||||
Reference in New Issue
Block a user