diff --git a/src/Filament/Resources/PageResource.php b/src/Filament/Resources/PageResource.php index f070eda..ca3d57a 100644 --- a/src/Filament/Resources/PageResource.php +++ b/src/Filament/Resources/PageResource.php @@ -216,6 +216,11 @@ public static function getNavigationLabel(): string return __('Pages'); } + public static function getNavigationBadge(): ?string + { + return (string) static::getEloquentQuery()->page()->count(); + } + public static function getActions(): array { $action = [ diff --git a/src/Filament/Resources/PostResource.php b/src/Filament/Resources/PostResource.php index 70af34e..95296ea 100644 --- a/src/Filament/Resources/PostResource.php +++ b/src/Filament/Resources/PostResource.php @@ -258,6 +258,11 @@ public static function getNavigationLabel(): string return __('Posts'); } + public static function getNavigationBadge(): ?string + { + return (string) static::getEloquentQuery()->posts()->count(); + } + public static function getActions(): array { $action = [