Feb 20, 2024
0
Level 1
Filament afterStateUpdated()
Good Day,
I am having hard time to make dependent states with FilamentPHP.
I have multiple Select Components in my form. And whenever a select occur i want other selects comes after it will be null again.
For example:
Section::make('Reservation Information')->schema([ TextInput::make('size')->label('Person Count')->numeric()->required()->minLength(1)- >maxLength(120), Select::make('table_location')->options(['Saloon', 'Terrace'])->label('Table Location') ])->columns(2),
when i use afterStateUpdated(fn(Get $get, Set $set)=>$set('table_location', null)) it just make its value under the hood null however my select box show as is selected as before.
Whats the solution here? anyone suffer same situation and found a solution?
Please or to participate in this conversation.