passing action arguments into nested actions
I have an action with footer actions. In those footer actions I need $arguments from the mountUsing on the parent. Not sure how to obtain those arguments in the child?
Solution:Jump to solution
```php
public function dayAction(): Action
{
return Action::make('day')
->label('Day Clicked')...
12 Replies
Trimmed for character limit
you mean makeModalSubmitAction?
https://filamentphp.com/docs/4.x/actions/modals#adding-an-extra-modal-action-button-to-the-footer
Ah, that could be it. my plan is having a click event that opens a modal, im shown 2 buttons, 1 to view the date I clicked in a calendar, and another that would update the modal form or redirect to another modal form to submit hours
I just couldnt get the arrguments passed into the action to go into the footer action
yes, I think
makeModalSubmitAction
. Try itJust on my lunch break now, will be back on in a few hours to give it a try, Ill leave this ticket open for now. Thank you 🙂
no no, try it right now
just kidding 😅
if it doesn't work, tag me and share the code that you are using ✌️
Yes boss! 🫡 🤣
Got like 3 projects on the go right now, its hectic. And I need to speak to the boss about alocating time to update our boilerplate to v4 - im running out of energy 🤣
From what I can see, that isnt working -> Is this just expecting data from the initial action?
Where im calling the action
Then I need those keys/values in the footer action
Could share the whole code on gist?
So I managed to add record, but still cant get the initial argument in. I can only share bits of it due to NDA
I've sent it via DM
Solution
and use
$this->mountAction('day', ['date' => now(), 'record' => 1])
don't forget this: The method must share the exact same name as the action, or the name followed by Action
So that did show the form, but when I try to use a function that returns form components, it doesnt show?
And the snippet of the function
Surely its not because im using sections and grids etc?
Oh, apparently it is, but also made me realise that I dont even need the form im trying to use 🤣
So your solution was spot on