Filament Tenancy
I've implemented the default tenancy of Filament, user can create multiple team and switched. However, I can only get the default team (first create team only) when switching to other team, how can I set the newly selected tenant to be the current team?
6 Replies
I've done this in testing, using
Filament::setTenant
but not yet done in actual switchingIt should be automatic on the switch. You can access it with Filament::getCurrentTenant() iirc
Undefined with
Filament::getCurrentTenant()
, what I've done, temporarily, I've created a helper function that sets current team using request()->tenant
and find that tenant in my model via slug
There is no such method getCurrentTenant()
using Filament version '^3.2'use
Filament::getTenant()
Yes you are correct but needs to set/update Tenant first using
setTenant
.It show be done automatically not by setting the tenant
Once you switch to different tenants it will also updates the current tenant