© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
G3z

Is it possible to add conditional confirmation on the save action ?

I tried the following in my
EditPage
EditPage
subclass to ask for confirmation on a set condition but the callback inside
requiresConfirmation
requiresConfirmation
is never called

protected function getSaveFormAction(): Action
{
    return Action::make('save')
        ->label(__('filament::resources/pages/edit-record.form.actions.save.label'))
        ->submit('save')
        ->keyBindings(['mod+s'])
        ->requiresConfirmation(function ($data) {
            if (false == empty($data['agreed_price'])) {
                if ($data['agreed_price'] != $data['sell_total_eur_gross']) {
                    return true;
                }
            }

            return false;
        });
}
protected function getSaveFormAction(): Action
{
    return Action::make('save')
        ->label(__('filament::resources/pages/edit-record.form.actions.save.label'))
        ->submit('save')
        ->keyBindings(['mod+s'])
        ->requiresConfirmation(function ($data) {
            if (false == empty($data['agreed_price'])) {
                if ($data['agreed_price'] != $data['sell_total_eur_gross']) {
                    return true;
                }
            }

            return false;
        });
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is it possible to add validation to a `Action::make()` before opening the confirmation modal?
FilamentFFilament / ❓┊help
2y ago
Is it possible to add a action on a textcolumn
FilamentFFilament / ❓┊help
3y ago
Is it possible to add actions to widgets?
FilamentFFilament / ❓┊help
3y ago
Is it possible to add paramaters to an import action?
FilamentFFilament / ❓┊help
3y ago