F
Filament11mo ago
Hugo

Confirmation modal before action.

Im trying to show a confirmation modal after pressing the submit button. At the moment it looks like this:
Action::make('generate_recap')
->label(__('events.recap.actions.create'))
->icon('fluentui-document-pdf-24-o')
->form(static::createRecapForm())
->action(function($data){
$client = Client::query()->where('id', $data['client_id'])->first();
(new PDFGenerator($data['client_id'],$data['delivery_address_id'], $data['month'], strval($data['year']), $data['contract']))->generateRecap();
}),
Action::make('generate_recap')
->label(__('events.recap.actions.create'))
->icon('fluentui-document-pdf-24-o')
->form(static::createRecapForm())
->action(function($data){
$client = Client::query()->where('id', $data['client_id'])->first();
(new PDFGenerator($data['client_id'],$data['delivery_address_id'], $data['month'], strval($data['year']), $data['contract']))->generateRecap();
}),
Adding an extraModalFooterAction and putting the submitAction to false could be a solution and i've tried it. The problem im running into is that I cant access the $data coming from the parent form. If I could access that $data I could probably execute the action I want upon confirming. What im looking for is: I have the action that I posted with my form. When I press the submit button I want a confirmation Modal to show. Upon confirming that modal I want to execute the action with the $data from the form.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server