Get the active tenant id

I have an action of removing a user in a company how can I get the active company Id of the login user
No description
1 Reply
Dimitar Papazov DEV
Is your "tenant" a Company? If it is you can get the current tenant : $tenant = Filament::getTenant(); Ref: https://filamentphp.com/docs/3.x/panels/tenancy#accessing-the-current-tenant or if tenant has nothing to do with the company, and you need the logged user's company, you should be able to get it like this: auth()->user()->companies()->first() or apply a scope to filter the current one.
Want results from more Discord servers?
Add your server