Refactor plant selection logic in ItemResource and StickerMasterResource to order by code
This commit is contained in:
@@ -601,7 +601,7 @@ class StickerMasterResource extends Resource
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->orderBy('code')->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
})
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||
|
||||
Reference in New Issue
Block a user