From 21f4befb167e8b33f0ceeab96fc2e31365f8d0d5 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 13 Apr 2023 00:40:52 -0400 Subject: [PATCH] Add configuration to manage navigation item --- config/filament-sanctum.php | 7 +++++++ src/Pages/Sanctum.php | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/config/filament-sanctum.php b/config/filament-sanctum.php index 0b78324..657df2f 100644 --- a/config/filament-sanctum.php +++ b/config/filament-sanctum.php @@ -2,6 +2,12 @@ return [ + 'navigation' => [ + 'should_register' => true, + 'sort' => -1, + 'group' => null, + ], + 'abilities' => [ 'users:read' => 'Read User', 'users:create' => 'Create User', @@ -12,6 +18,7 @@ 'blog:update' => 'Update Blog', 'blog:delete' => 'Delete Blog', ], + 'columns' => 4, ]; diff --git a/src/Pages/Sanctum.php b/src/Pages/Sanctum.php index 9b32b71..643342b 100644 --- a/src/Pages/Sanctum.php +++ b/src/Pages/Sanctum.php @@ -27,6 +27,18 @@ protected function getTitle(): string return trans('Sanctum'); } + protected static function getNavigationGroup(): ?string + { + return config('filament-sanctum.navigation.should_register', true) + ? config('filament-sanctum.navigation.group', null) + : ''; + } + + protected static function getNavigationSort(): ?int + { + return config('filament-sanctum.navigation.sort', -1); + } + protected static function getNavigationLabel(): string { return trans('Sanctum');