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:
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
Jump to solution
23 Replies
neverything
neverythingOP13mo ago
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
No description
No description
toeknee
toeknee13mo ago
Tenant would be a team, then scope the resources to the selected catalog/team I did similar tbh
neverything
neverythingOP13mo ago
Cool thank you, any tips for making it work properly? Should I add the selection of the current catalog into the tenant menu?
Solution
toeknee
toeknee13mo ago
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
neverything
neverythingOP13mo ago
Thank you, that's a great idea.
Nicole
Nicole3mo ago
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?
neverything
neverythingOP3mo ago
Not sure I understand your question. Yes, I’m using Jetstream teams as tenant in my Filament app in production.
Nicole
Nicole3mo ago
Like what is the idea of your project, Sir? Do you have different login for your jetstream and filament admin?
neverything
neverythingOP3mo ago
We have single login for the teams which goes to the main Filament admin panel.
Nicole
Nicole3mo ago
Technically, you just add redirection on it, cause I believe this one is belongs to jetstream, right?
No description
neverything
neverythingOP3mo ago
Yes, this was from the first version using Livewire and Jetstream directly. Now it uses the tenant menu from Filament
toeknee
toeknee3mo ago
It is fine, though I am phasing it out now and using native filament and spatie permissions with a teams model
neverything
neverythingOP3mo ago
Funny that you mention that, I'm going to do the same soon
Nicole
Nicole3mo ago
You're not using jetstream right now, Sir? Only the multi-tenancy feature of Filament?
toeknee
toeknee3mo ago
Exactly it’s just another dependency not needed really
Nicole
Nicole3mo ago
You're using filament multi-tenancy here, Sir?
toeknee
toeknee3mo ago
Yes
neverything
neverythingOP3mo ago
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
neverything
neverythingOP3mo ago
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.
Nicole
Nicole3mo ago
Is this package sufficient, or do you think Filament can handle all the requirements without needing the additional Jetstream library?
neverything
neverythingOP3mo ago
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.
Nicole
Nicole3mo ago
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
toeknee
toeknee3mo ago
I use that one, then #althinect-spatie-roles-permissions

Did you find this page helpful?