F
Filament•2d ago
charlie

Would it be hard to move a complete Filament project to Multi-tenancy ?

I have a quite big app, almost in prod. But the project goal has evolved in last months. The customizations are not insane, but... That's what I'm using: - 2 panels - 4 roles (with shield) - about 20 Livewire custom forms - 3 custom fields - 23 models - a lot of plugins from community 🙂 And I use a very large part of the available features in Filament. I don't need users being able to switch teams or any complex workflow. I want to sell my app to different clients on a monthly subscription (like a saas). I just have one for now. I'm currently looking for a solution where I can charge automatically each client and control what they can access.
6 Replies
awcodes
awcodes•2d ago
I’d start by checking all the plugins you are using to see if they support tenancy or not if it’s relevant to the plugin. The filament stuff shouldn’t be too difficult if you are planning on using filaments built in tenancy features. If you are going to use a 3rd party tenancy package, it can be done, but several people have had issues that weren’t so easy to solve.
charlie
charlieOP•2d ago
To be even more clear: The idea here would be: - a simple one-to-many tenancy (Users 1,2,3 belongs to Company 1 ; Users 4,5,6 belongs to Company 2) - if Company 1 subscription is up to date, then the Users 1, 2, and 3 will be able to use admin panel. It's so simple (at least in my mind) than I wonder if I really need multi tenancy. Although it seems I need it to use any billing system Ok, after reading the docs again. I do not need multi-tenancy. I just need simple one-to-many tenancy. Now I need to find the simplest way to bill my clients.
elmudometal
elmudometal•13h ago
It's not that complex, but it will depend a lot on the distribution of your app. If you have filters or data that are searched in those livewire or custom plugins, you should take that into account. The rest is quite simple to apply.
Dennis Koch
Dennis Koch•12h ago
When I introduced tenancy the most work was making tests work and fixing issues with storage
charlie
charlieOP•11h ago
Thanks to all of you. After a lot of thinking, I think I will go this way for now: - Each Company will have a separate install (1 subdomain, 1 database, 1 Laravel install) - On the main domain, i will install breeze, cashier, and try to make something simple - A scheduled task on main domain will post to a very minimal API in each subdomain if the subscription for that subdomain is ok or not. - Finally a simple middleware in each subdomain will check this status I prefer to have this separation to avoid a lot of concerns like security risks, database size, plugins compat, etc. The day I'll have more than 10 clients on this project, I will think about tenancy again. Let me know if you think that's a terrible solution 🙂
igorclauss
igorclauss•7h ago
Sounds very reasonable

Did you find this page helpful?