F
Filamentβ€’7mo ago
urbycoz

How can I make my form action show a confirmation modal?

I have a form with a delete action. I want it to fire the doDelete() method when clicked. But I want a confirmation modal to show first. However the code below doesn't seem to work. When I click the button nothing shows. If I take out the ->requiresConfirmation() then the doDelete() method is fired fine.
public function form(Form $form): Form
{
return $form
->schema([
...
Actions::make([
Action::make('delete')
->requiresConfirmation() // This doesn't make a modal show
->action(function () {
$this->doDelete($this->item->id);
})
]),
]);
}
public function form(Form $form): Form
{
return $form
->schema([
...
Actions::make([
Action::make('delete')
->requiresConfirmation() // This doesn't make a modal show
->action(function () {
$this->doDelete($this->item->id);
})
]),
]);
}
Solution:
Did you add <x-filament-actions::modals /> in the view?
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreiraβ€’7mo ago
Did you add <x-filament-actions::modals /> in the view?
urbycoz
urbycozOPβ€’7mo ago
πŸ‘† This guy is a legend!
Want results from more Discord servers?
Add your server