I think that it looks pretty good, I would most likely do something very similar.
Jan 17, 2025
2
Level 6
What do you think of this Multi Tenant Model Structure?
I want to have a multi-tenant Laravel app where a user can be assigned to multiple tenants.
The requirements are:
- Each tenant can have their own set of roles/permissions.
- A user can be assigned to multiple tenants with different permissions defined by the tenant
- Each tenant will have different modules, in this example lets say a projects module but this can extend to many more including things like an admin module
- For the projects module only users assigned to project can see it unless they have permission to see all projects in that tenant. Ideally I can use scopes to accomplish this along with policies.

Backup link if image doesn't load: https://i.postimg.cc/qRH5rHdQ/multi-tenant-laravel-setup.jpg
I would appreciate any feedback on this since I'm pretty new to multi-tenancy. Are there any obvious draw backs to this that I haven't accounted for?
As mentioned in the diagram I think I'll let the roles be handled by spatie / laravel-permission which I imagine would work well in this case: https://github.com/spatie/laravel-permission
Please or to participate in this conversation.