#how can i add requiresConfirmation when creating records

6 messages · Page 1 of 1 (latest)

unique torrent
#

i have trid this php protected function getCreateFormAction(): Action { return Action::make('create') ->action('create') ->requiresConfirmation(); }
but nothing seems to be working someone help me please

clever narwhalBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

sour summit
#

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?

little agate
clever narwhalBOT
unique torrent