© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago•
19 replies
Mark Chaney

Secondary Modal Submit Action with RequiresConfirmation

Im trying to add another submit action on a modal that requires a confirmation. Tried adding that, but cant seem to get access to the original actions form. Any suggestions? I tried also using makeSubmitAction too, but it doesnt allow you to add a requiresConfirmation or much else to it.
->modalFooterActions(function (Action $action) {
    return [
        $this->terminationRequiresReview() ? $this->submitTerminationForReviewAction($action) : $action->getModalSubmitAction(),
        $action->getModalCancelAction(),
    ];
})

$this->submitTerminationForReviewAction(Action $parentAction): Action
{
    return Action
        ->label('Submit for Review')
        ->requiresConfirmation()
        ->modalWidth(MaxWidth::ExtraLarge)
        ->modalHeading('Submit for Review')
        ->modalDescription('Are you sure you are ready to submit this action?')
        ->infolist([
            ShoutEntry::make('review-alert')
                ->content('Once reviewed you will be notified of the results of the review and provided with instructions for next steps.'),
        ])
        ->action(function (Action $action) {
            // need access to form data and it should be validated first like the normal submit action
            $this->saveFormData();
            $action->cancelParentActions();
        });
}
->modalFooterActions(function (Action $action) {
    return [
        $this->terminationRequiresReview() ? $this->submitTerminationForReviewAction($action) : $action->getModalSubmitAction(),
        $action->getModalCancelAction(),
    ];
})

$this->submitTerminationForReviewAction(Action $parentAction): Action
{
    return Action
        ->label('Submit for Review')
        ->requiresConfirmation()
        ->modalWidth(MaxWidth::ExtraLarge)
        ->modalHeading('Submit for Review')
        ->modalDescription('Are you sure you are ready to submit this action?')
        ->infolist([
            ShoutEntry::make('review-alert')
                ->content('Once reviewed you will be notified of the results of the review and provided with instructions for next steps.'),
        ])
        ->action(function (Action $action) {
            // need access to form data and it should be validated first like the normal submit action
            $this->saveFormData();
            $action->cancelParentActions();
        });
}
Solution
try
->modalFooterActions([
  Action::make('save_confirm')
    ->label('aubmit for review')
    ->requiresConfirmation()
    ->action('save')
    ->keyBindings(['mod+s'])
])
->modalFooterActions([
  Action::make('save_confirm')
    ->label('aubmit for review')
    ->requiresConfirmation()
    ->action('save')
    ->keyBindings(['mod+s'])
])
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Submit - requiresConfirmation
FilamentFFilament / ❓┊help
3y ago
requiresConfirmation - Disable Submit?
FilamentFFilament / ❓┊help
3y ago
Disabling Submit Action on Action With Custom Modal
FilamentFFilament / ❓┊help
3y ago
Action not working with requiresConfirmation()
FilamentFFilament / ❓┊help
2y ago