extraModalFooterActions, retrieving post $data?
I have a system to make schedules, schedules can be recurring. I want to have an extra FooterAction to "Save all future recurring schedules" instead of just the current one. Got that all to work with this (https://filamentphp.com/docs/3.x/actions/modals#adding-an-extra-modal-action-button-to-the-footer) But the problem is I cant add a requireConfirmation() to it then. That works with this perfectly BUT i can't retrieve the form $data (because it is a child?) Is there any method to fix this?
My code:
I feel like maybe this could help (https://discord.com/channels/883083792112300104/1237435510100594719/1237599157187903558) but maybe I am missing something obivous?
2 Replies
Those methods don't have a form so where should the data come from?
You can try
fn ($action) => $action->data
or ->formData
or similarYeah I now better understand the problem, that makes sense. If I dd($action) i dont see any form data in there. How can I solve this problem though? Or I have to just revert to something like:
I tried adding something like a mix between the two:
But using ->makeModalSubmitActionmakes the Action static..? I would also think that adding a second button to update all events (with requiresConfirmation) wouldn't be this hard. 😅
Ok so this works, but it feels very dirty:
Hope this helps someone else, but I hope there is a better way of doing this.
ugh relationships are not save like this of course, anyone a better solution?