Skip to content

Commit

Permalink
Add support to customise the nagivation group, by default it is Roles…
Browse files Browse the repository at this point in the history
… & Permissions (#32)

* Add role nagivation group customisation

* Add permission nagivation group customisation

* Add nagivation_section_group config option
  • Loading branch information
tonypartridge authored Mar 1, 2023
1 parent 4164998 commit ed54ac3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/filament-spatie-roles-permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
'preload_roles' => false,

'preload_permissions' => false,

'navigation_section_group' => 'filament-spatie-roles-permissions::filament-spatie.section.roles_and_permissions', // Default uses language constant

'generator' => [

Expand Down
2 changes: 1 addition & 1 deletion src/Resources/PermissionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function getLabel(): string

protected static function getNavigationGroup(): ?string
{
return __('filament-spatie-roles-permissions::filament-spatie.section.roles_and_permissions');
return __(config('filament-spatie-roles-permissions.navigation_section_group', 'filament-spatie-roles-permissions::filament-spatie.section.roles_and_permissions'));
}

public static function getPluralLabel(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function getLabel(): string

protected static function getNavigationGroup(): ?string
{
return __('filament-spatie-roles-permissions::filament-spatie.section.roles_and_permissions');
return __(config('filament-spatie-roles-permissions.navigation_section_group', 'filament-spatie-roles-permissions::filament-spatie.section.roles_and_permissions'));
}

public static function getPluralLabel(): string
Expand Down

0 comments on commit ed54ac3

Please sign in to comment.