production_order null exception solved
This commit is contained in:
@@ -302,9 +302,10 @@ class ProductionQuantityResource extends Resource
|
|||||||
return $get('item_code');
|
return $get('item_code');
|
||||||
})
|
})
|
||||||
->default(function () {
|
->default(function () {
|
||||||
// Get the latest 'item_id' foreign key from 'production_quantities' table
|
// $latestProductionOrder = ProductionQuantity::latest()->first()->production_order;
|
||||||
$latestProductionOrder = ProductionQuantity::latest()->first()->production_order;
|
// return $latestProductionOrder ?? null;
|
||||||
return $latestProductionOrder ?? null;
|
$latestProduction = ProductionQuantity::latest()->first();
|
||||||
|
return $latestProduction ? $latestProduction->production_order : null;
|
||||||
}),
|
}),
|
||||||
Forms\Components\TextInput::make('item_code')
|
Forms\Components\TextInput::make('item_code')
|
||||||
->label('Item Code')
|
->label('Item Code')
|
||||||
|
|||||||
Reference in New Issue
Block a user