How do I use actions on a ViewRecord page?
Hi, I've created a custom ViewRecord view for my resource with a section showing several buttons and actions. I've created an action that should open a modal with a form. The action is rendered correctly but when I click, I see the spinner and nothing happens (0 console or PHP errors).
Here my ViewRecord (without all stuffs) and a dump action :
And my view attached)
(I copied and pasted the default view and added my part)
I also tried to follow that guide : https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component with adding this but nothing changed :
I thought it might be coming from the Section, so I removed the button to put it lower down, but the same thing happened...
Can somebody help me ?
Thanks 🙂
Solution:Jump to solution
Do you really need to overwrite the view? Header Actions don't fit for your use case?
Regarding the action:
The action name and the function must match. In your case the function should be named
testAction()
...7 Replies
Try using $arguments:
Hi, thanks for your answer but that didn't change anything 😥
Ah shoot! It did the trick for me: https://discord.com/channels/883083792112300104/1342447016567115827
Good luck!
Solution
Do you really need to overwrite the view? Header Actions don't fit for your use case?
Regarding the action:
The action name and the function must match. In your case the function should be named
testAction()
Yes, it's for a client and the process is quite... Special. They want to force their users to go through the details before seeing the action buttons, so I've put this in a section in my view below the InfoList 🙂
And... I was just about to reply, because I've found the solution and it's what you've just written. I'll have to pay more attention to the documentation, especially the comments in the code 😅
Cf. https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component#adding-the-action
Thank you very much for your help and your time 🙏

Not just the code 😅
The method must share the exact same name as the action, or the name followed by Action:
Oh mamma mia, I'm an idiot but it's almost the weekend 😂. I'm going to make the most of it by picking daisies in the fields and getting some fresh air. 😂
Sorry 😅