How can we use route parameters with Filament panels? #12757
Replies: 3 comments 9 replies
-
I think you should override the route in you web.php file |
Beta Was this translation helpful? Give feedback.
-
Not sure if you've already tried it, but I had a similar requirement and after trying different things (clusters, nested resources, etc.), I actually solved it using Multi-tenancy. When you specify that a Panel has a tenant model (in your case, I would choose the Organization model), you effectively give it a parameter. You can then access models scoped by relationships with the current tenant via global scopes and/or by accessing the current tenant with The documentation on that page is very thorough and covers several use cases, and you can customize your setup a bit (e.g., I chose not to have registration/profile pages). Let us know how it goes! |
Beta Was this translation helpful? Give feedback.
-
I was able to get multi-tenancy working by creating a pivot table for organization_user. I was avoiding it because I didn't really need it since I have a one-to-many table that stores a user's member record per organization, but that's the only way I could get tenancy to work. It seems like Filament requires a many-to-many relationship for the multi-tenancy. I'm using the member model's saved lifecycle event to update the pivot table, so it is low maintenance. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
Package
Panel builder
Package Version
v3
How can we help you?
I need to set a route slug parameter to use a particular model instance with the panel panel. For example,
/organization/{organization:slug}/
. How can we modify Filament routes to include parameters? ThanksBeta Was this translation helpful? Give feedback.
All reactions