F
FilamentAdnan Yalahow

how can i add requiresConfirmation when creating records

i have trid this
protected function getCreateFormAction(): Action
{
return Action::make('create')
->action('create')
->requiresConfirmation();
}
protected function getCreateFormAction(): Action
{
return Action::make('create')
->action('create')
->requiresConfirmation();
}
but nothing seems to be working someone help me please
Solution:
```php protected function getCreateFormAction(): Action { return parent::getCreateFormAction() ->submit(null)...
PK
Povilas K•16d ago
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'));
}
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?
Solution
L
LeandroFerreira•16d ago
protected function getCreateFormAction(): Action
{
return parent::getCreateFormAction()
->submit(null)
->requiresConfirmation()
->action(fn () => $this->create());
}
protected function getCreateFormAction(): Action
{
return parent::getCreateFormAction()
->submit(null)
->requiresConfirmation()
->action(fn () => $this->create());
}
?
AY
Adnan Yalahow•16d ago
ohh Thank you This solved my problem I have tried something similar and it did not fulfil my requirements, but i appreciate your help🙂
Want results from more Discord servers?
Add your server
More Posts
Uploading new image to a prefilled spatie media file upload not working in custom page with formsI have a custom page with forms. I have multiple file inputs. The file inputs successfully shows theSelect::selectablePlaceholder(false) not working with relationshipsI have the following select component, which correctly displays as a list of the user's leads, with Select HasMany relationship with CreateOptionAccording to the docs the ability to create a new option on the fly only supports `BelongsTo` and `BRelation Manager not in modalI need from a Relation Manager to be open not in a modal but in a new page, but that page should havHow to return the Wizard to step 1 after create success in custom page.Hello, I have created a custom page using the form following schema this form saves the data into exHaving issues with spa() and https and logoutWhen put URL::forceScheme('https') in boot() in AppServiceProvider, my panel spa() does not work. BuDynamic Form ValidationsHi, We stored different validations in database. How can we dynamically apply Filament field validatHow to dispatch filament form data using blade $dispatch methodWhen I am trying to `$dispatch` an event to send filament form data, it is not sending updated form Help Needed: Unexpected Behavior in Laravel Filament with APP_DEBUG=trueI'm encountering an issue with Laravel Filament not functioning as expected on my local development Lazy loading for Select form component optionsHey there! Is anyone aware of a way to lazy load the options of a Select form component? Right nowTabs/Costumer/installmentsHi team, I have doubts as to whether it is possible to show a list in the customer's installments taspa mode does not seem to work with Laravel 11I had observed that the Spa() does not get affect to the site. It just like without using spa(), thePlacing a save button in the headerHello, this is perhaps very simple to do. I haven't found in the documentation (or I didn't look carUser menu width problemsHello, I don't know what cause but my User Menu Dropdown is taking 100% of width. The only change t