Setting the default tenant doesn't seem to work as expected
I'm running Filament v3.2.2 and I followed the docs in setting the default tenant https://filamentphp.com/docs/3.x/panels/tenancy#setting-the-default-tenant
However, Filament doesn't seem to update the 'latest_team_id' field of the users table in the database whenever I change the tenant using the tenant menu. Is this the expected behavior? If so, how do I hook into the tenant menu to update the 'latest_team_id' field when changing tenant?
I tried manually updating the 'latest_team_id' field in the database and Filament picks it up and redirects me to the correct team's dashboard whenever I sign in.
3 Replies
Bump
I think filament doesn't do this automatically, so I did it myself. Made a function in User model:
And in a middleware that I'm using to check some rights (using spatie permissions/teams)
Now it all works perfectly with me. Although it is probably not the most elegant solution. π
Thank you