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();
    }

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?
Was this page helpful?