requiresConfirmation doesn't seem to work on form submit action
hi all!
I'm adding a custom form on a custom page but can't seem to add requiresConfirmation() to the form submit.
The Form part:
The blade;
The action method;
- Why is the requiresConfirmation not firing?
- Do you see general improvements in this custom form approach?
Thanks!!
5 Replies
Think that
<x-filament-actions::modals />
needs to go into your view.
See: https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-formrename
Action::make('save')
to Action::make('getClearCacheSave')
I'm using the filament page component, I believe it's already there. Adding the thing in the view didn't make a difference. Thanks though!
what does getClearCacheSave refer to? Adding this didn't make a difference, but thanks π
remove submit and add
->action(fn () => $this->clearCache())
Thanks for the suggestion Leandro!, will try this tomorrow and get back to you on it here
@Leandro Ferreira the trick was to not use ->submit('clearCache'), but instead use ->action(). So you were absolutely right π This combined with the lack of the <x-filament-actions::modals /> in the view together now made it work. Thanks for the help