Skip to content

Commit

Permalink
Merge pull request #6 from leek/feature/navigation-config
Browse files Browse the repository at this point in the history
Add configuration to manage navigation item
  • Loading branch information
Kristories authored Jul 24, 2023
2 parents 37d2bc7 + 21f4bef commit eb0473b
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 eb0473b

Please sign in to comment.