Skip to content

Commit

Permalink
Add configuration to manage navigation item
Browse files Browse the repository at this point in the history
  • Loading branch information
leek committed Apr 13, 2023
1 parent fd03821 commit 21f4bef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/filament-sanctum.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

return [

'navigation' => [
'should_register' => true,
'sort' => -1,
'group' => null,
],

'abilities' => [
'users:read' => 'Read User',
'users:create' => 'Create User',
Expand All @@ -12,6 +18,7 @@
'blog:update' => 'Update Blog',
'blog:delete' => 'Delete Blog',
],

'columns' => 4,

];
12 changes: 12 additions & 0 deletions src/Pages/Sanctum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 21f4bef

Please sign in to comment.