filament-shield
filament-shield copied to clipboard
Error on composer update
Get this error after update (composer update) to latest version (3.2.4). Current FIlament Version = 3.2.62.
Symfony\Component\ErrorHandler\Error\FatalError
Declaration of BezhanSalleh\FilamentShield\Traits\HasPageShield::canAccess(): bool must be compatible with Filament\Resources\Pages\Page::canAccess(array $parameters = []): bool
at vendor/bezhansalleh/filament-shield/src/Traits/HasPageShield.php:75
71▕ {
72▕ return static::canView() && parent::shouldRegisterNavigation();
73▕ }
74▕
➜ 75▕ public static function canAccess(): bool
76▕ {
77▕ return static::canView();
78▕ }
79▕ }
Updating vendor/bezhansalleh/filament-shield/src/Traits/HasPageShield.php canAccess() signature to: public static function canAccess(array $parameters = []): bool fixes the problem.
the method signature might have changed and then changed back cause right now in the entire filament repo i cannot find the canAccess()
method to accept params.
I know this is closed, but I now have the exact same issue with shouldRegisterNavigation
- it now expects an argument of array $parameters = []