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
Did you add <x-filament-actions::modals /> in the view?
urbycoz
urbycoz4w ago
👆 This guy is a legend!