Skip to content

Commit

Permalink
Merge pull request #226 from lara-zeus/fix-badge-count
Browse files Browse the repository at this point in the history
fix badge count for multi tenant
  • Loading branch information
atmonshi authored Jan 8, 2024
2 parents 1265011 + 6017526 commit 3099ab3
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 467 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0, 8.1]
laravel: [9.*, 10.*]
php: [8.2]
laravel: [10.*]
stability: [prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
exclude:
- laravel: 10.*
php: 8.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
937 changes: 483 additions & 454 deletions composer.lock

Large diffs are not rendered by default.

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 3099ab3

Please sign in to comment.