Added required mapping for import columns and Updated plant selection logic in various resources on Advanced Filters

This commit is contained in:
dhanabalan
2025-10-08 17:46:19 +05:30
parent 377fd4c615
commit 98dc59538f
16 changed files with 177 additions and 123 deletions

View File

@@ -283,8 +283,12 @@ class GuardPatrolEntryResource extends Resource
Select::make('Plant')
->label('Select Plant')
->nullable()
->options(function () {
return Plant::pluck('name', 'id');
// ->options(function () {
// return Plant::pluck('name', 'id');
// })
->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();
})
->reactive(),
// ->afterStateUpdated(function ($state, callable $set, callable $get) {