F
Filament6mo ago
Azorky

Toggle afterStateUpdated call action

I would like when someone clicks the toggle, that a confirmation modal pop's up asking the user if he's sure that he wants to enable it. How can I do this? How can I call an action using afterStateUpdated?
9 Replies
Azorky
Azorky6mo ago
Maybe with an action in afterStateUpdated or something?
Matthew
Matthew6mo ago
nah, you just add ->requiresConfirmation()
Azorky
Azorky6mo ago
Require confirmation doesn't exist on a toggle, only on actions. Somehow it should be possible to call an action from an
->afterStateUpdated()
->afterStateUpdated()
No description
Matthew
Matthew6mo ago
Ohhh my bad. I have to think about this one. I cant look it up rn but maybe later tonight but i believe it should be possible
Azorky
Azorky6mo ago
That would be awesome, I appreciate it! So far I haven't found a way, bit it would be a nice feature (in case it doesn't exist of course)
Matthew
Matthew6mo ago
😦 After doing a lot of experimenting, I couldnt find a way unfortunately I might make a PR to support this nativaly from filament
awcodes
awcodes6mo ago
Are you trying to do this in a form or in a table? Just curious.
Azorky
Azorky6mo ago
In a form