Help with resource actions
What I am trying to do:
I Have a resource who has a user related to it.
In the table i have a column to show who is this user.
So, i want when I click the column show a modal with infos of the user(a view action)
What I did:
The column:
My issue/the error:
The action try to get the table record(Execution) but i explicit say what model the action should use.
8 Replies
On the column component you can add ->action(Define Filament Row Action Here) I believe. And possibly ->form() too.
Already do:
The problem is the actions is trying to get the infos to the form in the wrong model.

When i click the User, a exception is thrown because the infos that the form needs do not exists in the Execution Model, but i need the action to use the User Model
But, i alredy told the action what model to use. And is not working :0
Obs: In this case is the V4 filament, the form method is deprecated
The action try to get the table record(Execution) but i explicit say what model the action should useYou added
->record(fn (Execution <--
Which says: Give me an instance of Executionbut how i can say to the action the record i want.
in this case the $execution->executioner, which is a user
i want to open the User view modal for the $execution->executioner(User model related to the Execution)
I would adjust the schema to be a state path tbh
free-typed but along those lines
This not worked.
No one know a solution?
It makes no sense why it wouldn’t work.
Please provide the code you are using an are you using DD to ensure the record is as expected.
What didn’t work?