F
Filament13mo ago
Gaspar

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():
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
public static function getNavigationBadge(): ?string
{
return static::getModel()::count();
}
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
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server