Question about tenants with jetstream teams and multiple resources
What I am trying to do:
I'm in the process of refactoring a Livewire 3 app into Filament. I used jetstream teams, but removed the personal teams. Every team can have multiple catalogs which contain products, links and exports (which would be the resources) related to the catalog.
My questions:
- How do I setup the multi-tenancy: Should it be based on teams or catalogs?
- Is it possible to have "sub-resources" when I'm in a specific catalog?
Solution:Jump to solution
Just use the Tenants menu as normal for the Team. Then the catalog can be a custom select which sets a session value and your global scope on your models uses that else it returns blank
23 Replies
Here are two images of the current app to better illustrate it. The top right corner is the team selector from Jetstream and in this team, there are multiple catalogs. The second screenshot is the product view of a single catalog
Tenant would be a team, then scope the resources to the selected catalog/team
I did similar tbh
Cool thank you, any tips for making it work properly? Should I add the selection of the current catalog into the tenant menu?
Solution
Just use the Tenants menu as normal for the Team. Then the catalog can be a custom select which sets a session value and your global scope on your models uses that else it returns blank
Thank you, that's a great idea.
Hello @toeknee @neverything So is it really fine to use jetstream teams with filament multi-tenancy?
I mean what is the use of your laravel filament here?
Not sure I understand your question. Yes, I’m using Jetstream teams as tenant in my Filament app in production.
Like what is the idea of your project, Sir? Do you have different login for your jetstream and filament admin?
We have single login for the teams which goes to the main Filament admin panel.
Technically, you just add redirection on it, cause I believe this one is belongs to jetstream, right?
Yes, this was from the first version using Livewire and Jetstream directly. Now it uses the tenant menu from Filament
It is fine, though I am phasing it out now and using native filament and spatie permissions with a teams model
Funny that you mention that, I'm going to do the same soon
You're not using jetstream right now, Sir? Only the multi-tenancy feature of Filament?
Exactly it’s just another dependency not needed really
You're using filament multi-tenancy here, Sir?
Yes
I do use Jetstream, leaving out most of the UI. The login is Filament, but I added the team settings page and user profile page from Jetstream using a customized version of https://github.com/stephenjude/filament-jetstream
GitHub
GitHub - stephenjude/filament-jetstream: Integrate all Laravel Jets...
Integrate all Laravel Jetstream features into your Filament application. - stephenjude/filament-jetstream
As mentioned by @toeknee, going forward I'll be phasing out most of the Jetstream stuff as I don't need it anymore and want to use the stuff Filament provides more.
Is this package sufficient, or do you think Filament can handle all the requirements without needing the additional Jetstream library?
You will have to take care of team settings and roles, user invites, two factor auth and api tokens yourself, if you don’t use Jetstream.
Thanks!
Sir @toeknee hello, regarding Spatie Permission, is there any specific package you installed, or should this be installed directly? https://spatie.be/docs/laravel-permission/v6/installation-laravel
I use that one, then #althinect-spatie-roles-permissions