Filament Action inside a custom Livewire component
I'm basically using Actions and Forms outside the Filament Panel and I'm stuck on the edit action which is I'm trying to do (this is inside a loop).
I wanted to have an edit action for each item and load the modal form which is I'm also using for create action (create is working) I'm just stuck on the edit action part.
I'm not sure if I'm doing this right and I can't find any reference in the docs.
Solution:Jump to solution
Yes, all components were loaded.
I managed to make it work by creating a child component listingItem to handle each item.
Thanks for responding @gladjanus43...
2 Replies
Did you load the actions component? Let me look up, i have used actions in loops as well
One thing I now is that you must have the same name for the function and the action. This is the code that works for me:
the action::make must match the function name! Something to do with caching I think.
And then in your view just pass the argument to the action like this:
{{($this->orderToInvoiceAction)(['order' => $record->id])}}
Solution
Yes, all components were loaded.
I managed to make it work by creating a child component listingItem to handle each item.
Thanks for responding @gladjanus43