Skip to content

Commit

Permalink
fix badge count for multi tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Jan 8, 2024
1 parent 1265011 commit 6ce7908
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/Filament/Resources/BoltResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ public static function canViewAny(): bool
&& parent::canViewAny();
}

public static function getNavigationBadge(): ?string
{
return (string) static::getModel()::query()->count();
}

public static function getNavigationGroup(): ?string
{
return BoltPlugin::get()->getNavigationGroupLabel();
Expand Down
5 changes: 5 additions & 0 deletions src/Filament/Resources/CategoryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public static function getModel(): string
return BoltPlugin::getModel('Category');
}

public static function getNavigationBadge(): ?string
{
return (string) BoltPlugin::getModel('Category')::query()->count();
}

public static function getGloballySearchableAttributes(): array
{
return ['name', 'slug'];
Expand Down
5 changes: 5 additions & 0 deletions src/Filament/Resources/CollectionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public static function getModel(): string
return BoltPlugin::getModel('Collection');
}

public static function getNavigationBadge(): ?string
{
return (string) BoltPlugin::getModel('Collection')::query()->count();
}

public static function getGloballySearchableAttributes(): array
{
return ['name', 'values'];
Expand Down
5 changes: 5 additions & 0 deletions src/Filament/Resources/FormResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public static function getModel(): string
return BoltPlugin::getModel('Form');
}

public static function getNavigationBadge(): ?string
{
return (string) BoltPlugin::getModel('Form')::query()->count();
}

public static function getGloballySearchableAttributes(): array
{
return ['name', 'slug'];
Expand Down
5 changes: 5 additions & 0 deletions src/Filament/Resources/ResponseResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public static function getModel(): string
return BoltPlugin::getModel('Response');
}

public static function getNavigationBadge(): ?string
{
return (string) BoltPlugin::getModel('Response')::query()->count();
}

public static function getModelLabel(): string
{
return __('Entries');
Expand Down

0 comments on commit 6ce7908

Please sign in to comment.