Best Approach for Filament Multi-Tenancy with One-to-Many User-tenant Relationship
Hi everyone, I’m new to Filament and want to implement multi-tenancy in my app. In my case, each user belongs to only one tenant/team (so it’s a simple one-to-many relationship). I’d like to use subdomain routing to identify tenants (like tenant1.example.com). However, I noticed in the Filament docs that it mentions a many-to-many relationship needs to exist between users and teams for multi-tenancy to work. Is it possible (and simpler) to implement multi-tenancy with just a one-to-many relationship in Filament, or do I need to set up a many-to-many relationship? What’s the recommended approach for my use case?
Thanks!
1 Reply
Filament Daily
YouTube
Filament Multi-Tenancy: Example of One Team per User
A demo project of how multi-tenancy works in Filament.
Full project: https://filamentexamples.com/project/multi-tenancy-with-one-team-for-user
Docs of multi-tenancy: https://filamentphp.com/docs/3.x/panels/tenancy