filament-shield icon indicating copy to clipboard operation
filament-shield copied to clipboard

Error on composer update

Open danielschweiger opened this issue 10 months ago • 1 comments

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▕ }

danielschweiger avatar Apr 03 '24 14:04 danielschweiger

Updating vendor/bezhansalleh/filament-shield/src/Traits/HasPageShield.php canAccess() signature to: public static function canAccess(array $parameters = []): bool fixes the problem.

gvds avatar Apr 05 '24 08:04 gvds

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.

bezhanSalleh avatar May 13 '24 23:05 bezhanSalleh

I know this is closed, but I now have the exact same issue with shouldRegisterNavigation - it now expects an argument of array $parameters = []

rominronin avatar Jul 03 '24 09:07 rominronin