How to add requiresConfirmation() into modalSubmitAction() in Action

Hello,

I have an action in my ListRecords page who open a modal and I need to have a modal of confirmation when the user click on the Button Submit.

Action::make('settings')
  ->form(...)
  ->action(...)
  ->modalSubmitAction(fn($action) => $action
      ->label('Enregistrer')
      ->requiresConfirmation() // this way doesn't work...
  )
  ->modalCancelAction(fn($action) => $action->label('Fermer'));


It doesn't work because it's a StaticAction in modalSubmitAction().
How can I do that?
Thanks
Was this page helpful?