bezhanSalleh / filament-shield

The easiest and most intuitive way to add access management to your Filament Admin Resources, Pages & Widgets through `spatie/laravel-permission`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getLocalizedPageLabel, type string, array given

bamod33 opened this issue · comments

Error: BezhanSalleh\FilamentShield\FilamentShield::getLocalizedPageLabel(): Argument #1 ($page) must be of type string, array given, called in /vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 355

In function:

`public static function getPageOptions(): array

{

    return collect(FilamentShield::getPages())

        ->flatMap(fn ($pagePermission) => [

            $pagePermission => FilamentShield::getLocalizedPageLabel($pagePermission),

        ])

        ->toArray();

}`

(Laravel 10, PHP 8.3, Filament v3.2.3)

Previously it was working well, it seems that a composer update broke something

Most likely you have published the shield resource. So republish it again and adjust your code accordingly if any.

Most likely you have published the shield resource. So republish it again and adjust your code accordingly if any.

Solved, thanks