Is there a way to listen or hook into when a user switches team?
As the title state, I am wondering if there is a way to execute some code when a user switches team in the panel. I am using the base tenancy that comes with filament.
Solution:Jump to solution
I don't think theres a tenant switcher persay as you can alternate between tenants without issue since we are tenant scoped, but not per tennat limited.
So you could have a middleware and a current_tenant_id on the usermodel, if Auth::user()->current_tennat_id !== Filamentphp::getTenant()->id, then change it to the tennat id and log change....
4 Replies
Solution
I don't think theres a tenant switcher persay as you can alternate between tenants without issue since we are tenant scoped, but not per tennat limited.
So you could have a middleware and a current_tenant_id on the usermodel, if Auth::user()->current_tennat_id !== Filamentphp::getTenant()->id, then change it to the tennat id and log change.
Oh, that's a good idea. Thanks!
I think there is also a TenantSet event or something
Good spot Andrew