removed default section of plant
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 28s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 25s
Laravel Pint / pint (pull_request) Successful in 2m47s
Laravel Larastan / larastan (pull_request) Failing after 4m4s

This commit is contained in:
dhanabalan
2026-11-25 15:45:31 +05:30
parent f8fd7d20bf
commit aaecd9a9e8

View File

@@ -51,11 +51,11 @@ class ProductCharacteristicsMasterResource extends Resource
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray(); return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
}) })
->disabled(fn (Get $get) => ! empty($get('id'))) ->disabled(fn (Get $get) => ! empty($get('id')))
->default(function () { // ->default(function () {
$userHas = Filament::auth()->user()->plant_id; // $userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? $userHas : optional(ProductCharacteristicsMaster::latest()->first())->plant_id; // return ($userHas && strlen($userHas) > 0) ? $userHas : optional(ProductCharacteristicsMaster::latest()->first())->plant_id;
}) // })
->afterStateUpdated(function ($state, callable $set) { ->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name); $set('updated_by', Filament::auth()->user()?->name);
$set('item_id', null); $set('item_id', null);