how to scope count in multi-tenancy?
I use
tenant
in my panel. It scopes records by user. Logic is in ApplyTenantScopes::class
. And it works correctly.
However is also use count()
in Resource getNavigationBadge()
:
That is not scoped anymore (it counts all records).
How to resolve this?
Should i put double logic in my Model also?
Or i can use ApplyTenantScopes::class
(logic) in here somehow?0 Replies