Filament not pulling from latest_team_id when coming back to the panel that has tenancy.
I've added the
HasDefaulTenant
to my user model as well as the methods described in the docs, but it doesn't seem to do anything.
I was able to set the current team when a user selects it by adding it to my ApplyTenantScopes
middleware. So when I select a team in my app panel, it's stored in the DB. However, if I go to my admin panel (no tenancy), and then come back to my app panel, it's always just going to the first team. It doesn't seem to be taking into account the latest_team_id on the user model.
My AppPanelProvider
:
My user model:
2 Replies
You sure that latest_team_id is updated correctly?
I'd also advise you to not make the middleware persistent, as ajax requests don't have the tenant in the URL, so it can't be determined. Might also be source of the problem, depending on how you implemented the middleware. Care to share the code?
Yeah, this my
ApplyTenantScopes
class: