Modal from an extra footer action to bind with modal form?

Is there a way make modal extra footer action to work with modal the modal form in terms of validation and form data access. The point is to be able to trigger confirmation after filling the modal form before action. Action::make('edit') ->form([ // ... ]) ->extraModalFooterActions([ Action::make('submit') ->requiresConfirmation() ->action(function () { // $data }), ])
Solution:
Sorry guess I’m just not fully following the use case. Is this what you are trying to achieve: https://filamentphp.com/docs/3.x/actions/modals#opening-another-modal-from-an-extra-footer-action
Jump to solution
12 Replies
Mikail
MikailOP6d ago
????
awcodes
awcodes6d ago
Why not just have the confirmation on the parent modal? Not following the use case.
Mikail
MikailOP5d ago
The parent modal is treated as form instead with 3 select input. Like a quick condition before the actual action. Does that make sense? ??
Mikail
MikailOP2d ago
tried them but non has requireConfirmation()
awcodes
awcodes2d ago
I’m not sure if it works with extra footer actions, but you could try injecting the $data into the function callback.
->action(function(array $data) {
dd($data);
})
->action(function(array $data) {
dd($data);
})
https://filamentphp.com/docs/3.x/actions/advanced
awcodes
awcodes2d ago
I would still expect requiresConfirmation() to work on the main action though.
Mikail
MikailOP2d ago
yes $data do work here. the issue is getting a confirmation before final submit. I treated the first modal as form submission. so form was used instead of confirmation.
awcodes
awcodes2d ago
According to the docs it should just work without the extra modal actions. https://filamentphp.com/docs/3.x/actions/modals#confirmation-modals
Mikail
MikailOP2d ago
I'm using a modal form which also behave like a confirmation. the submit action simply take off. Was looking for a situation where the submit triggers another modal action for confirmation.
No description
Solution
awcodes
awcodes2d ago
Sorry guess I’m just not fully following the use case. Is this what you are trying to achieve: https://filamentphp.com/docs/3.x/actions/modals#opening-another-modal-from-an-extra-footer-action
Mikail
MikailOP9h ago
Oh wow this just worked effortlessly, thank you. Then i was able to pass the form $data from the parent modal with $data = $livewire->mountedTableActionsData[0];. It wasn't avaiable in $data array.

Did you find this page helpful?