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