diff --git a/app/Filament/Resources/WorkGroupMasterResource.php b/app/Filament/Resources/WorkGroupMasterResource.php index b1d7f2c..8b21ab2 100644 --- a/app/Filament/Resources/WorkGroupMasterResource.php +++ b/app/Filament/Resources/WorkGroupMasterResource.php @@ -56,17 +56,20 @@ class WorkGroupMasterResource extends Resource ->afterStateUpdated(function ($state, $set, callable $get) { $plantId = $get('plant_id'); - $set('pqPlantError', null); + $set('wgmPlantError', null); $set('name', null); $set('description', null); $set('operation_number', null); if (! $plantId) { - $set('pqPlantError', 'Please select a plant first.'); + $set('wgmPlantError', 'Please select a plant first.'); return; } }) - ->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null) + ->extraAttributes(fn ($get) => [ + 'class' => $get('wgmPlantError') ? 'border-red-500' : '', + ]) + ->hint(fn ($get) => $get('wgmPlantError') ? $get('wgmPlantError') : null) ->hintColor('danger'), Forms\Components\TextInput::make('name') ->label('Group Work Center')