Skip to content

Commit

Permalink
ability to show or hide resource navigation through config
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhanSalleh committed Nov 16, 2022
1 parent 9cc19e0 commit b2700e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/filament-shield.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [
'shield_resource' => [
'show_in_navigation' => true,
'should_register_navigation' => true,
'slug' => 'shield/roles',
'navigation_sort' => -1,
'navigation_badge' => true,
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public static function getPluralModelLabel(): string

protected static function shouldRegisterNavigation(): bool
{
return Utils::isResourceNavigationItemEnabled();
return Utils::isResourceNavigationRegistered();
}

protected static function getNavigationGroup(): ?string
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static function getResourceSlug(): string
return (string) config('filament-shield.shield_resource.slug');
}

public static function isResourceNavigationItemEnabled(): bool
public static function isResourceNavigationRegistered(): bool
{
return config('filament-shield.shield_resource.show_in_navigation', true);
return config('filament-shield.shield_resource.should_register_navigation', true);
}

public static function getResourceNavigationSort(): int
Expand Down

0 comments on commit b2700e3

Please sign in to comment.