relationManger nested
I'm building admin and user panel with filament.
in admin panel i have a usersResource and relationManger that is name is "CampaignsRelationManager".
in user panel i have a campaigns resource and relationManger that is name is "CampCouponRelationManager".
i want to add CampCouponRelationManager to CampaignsRelationManager under the admin panel.
Basically, it means to create a relationManger inside a relationManger
Solution:Jump to solution
Yeah sure, it is just a custom action on the table:
Inside your relationmanager in the actions array you can do something like this:
```php
->actions([...
7 Replies
Take a look at guava-nested-resource plugin - it's still in alpha but handles simple nesting (I use it in a project that required 4 level deep RM nesting) https://discord.com/channels/883083792112300104/1167940700130791574 I believe native filament support for nested resources is on the v4 roadmap
I will check it.
Thank you!
I had a similar requirement but didnt like all the relation manager under eachother. I made a slide over with a repeater in it. I think this is better UX if there are not a lot of records in the "relation of the relation"
I can share the code if you want!
Thanks!
It will also work well if the coupons appear as a resource in the user's panel?
I'm pretty new to filament..
Solution
Yeah sure, it is just a custom action on the table:
Inside your relationmanager in the actions array you can do something like this:
And AttachmentRelationResources::getAttachmentRepeaterForm() is where I retrieve the form
In my case it is
Thank you so much!