Skip to content

Commit

Permalink
Update HasPageShield.php
Browse files Browse the repository at this point in the history
add required parameter in shouldRegisterNavigation() and canAccess() methods to compatible with filament
  • Loading branch information
naingwin authored Nov 6, 2024
1 parent a71ca76 commit 5f248ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Traits/HasPageShield.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ protected static function getPermissionName(): string
->toString();
}

public static function shouldRegisterNavigation(): bool
public static function shouldRegisterNavigation(array $parameters = []): bool
{
return static::canAccess() && parent::shouldRegisterNavigation();
}

public static function canAccess(): bool
public static function canAccess(array $parameters = []): bool
{
return Filament::auth()->user()->can(static::getPermissionName());
}
Expand Down

0 comments on commit 5f248ad

Please sign in to comment.