From 019a5cffc9ffee0f4382858209c1e64e139f09d6 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Tue, 5 Mar 2024 14:37:25 -0500 Subject: [PATCH] fix page/post count being the same --- src/Filament/Resources/PageResource.php | 5 +++++ src/Filament/Resources/PostResource.php | 5 +++++ 2 files changed, 10 insertions(+) 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 = [