#how can i add requiresConfirmation when creating records
6 messages · Page 1 of 1 (latest)
Not sure if that would be any help, but I tried to reproduce and indeed the default create action doesn't trigger confirmation, but any custom callback function instead, would actually work with confirmation.
protected function getCreateFormAction(): Action
{
return Action::make('create')
->requiresConfirmation()
->action(fn () => Notification::make()->title('Created!')->send())
->label(__('filament-panels::resources/pages/create-record.form.actions.create.label'));
}
This worked for me.
So, maybe consider building a custom action instead of the default?
protected function getCreateFormAction(): Action
{
return parent::getCreateFormAction()
->submit(null)
->requiresConfirmation()
->action(fn () => $this->create());
}
?
Thank you for marking this question as solved!
Learn more
ohh Thank you
This solved my problem