How do you get the current tenant id?
I'd like to get the current team id (team = my tenant) when in a controller, e.g.
But it's returning "null" (also returns null if I just do
But it's returning "null" (also returns null if I just do
Filament::getTenant();Solution
Had to go digging in the filament vendor package... Basically, you add an event listener to the setTenant function.
Then in your new file (e.g.
And then you need to register your new listener in
php artisan make:listener UpdateLatestTeamId --event=TenantSetThen in your new file (e.g.
app/Listeners/UpdateLatestTeamId.php) you could putAnd then you need to register your new listener in
app/Providers/EventServiceProvider.php like so