hexters / hexa-docs

Effortless role and permission management plugin for Filament
Other
0 stars 0 forks source link

Gate problem #2

Closed ankorinek closed 1 month ago

ankorinek commented 2 months ago

I installed the package and added the code to the panel and resource as shown in the help. I can login with the hexa admin user account, but then get the following problem:

App\Policies\BranchSectionPolicy::viewAny(): Argument #1 ($user) must be of type App\Models\User, App\Models\Admin given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 811

hexters commented 1 month ago

Maybe because Hexa is using guard auth:admin, you can write the viewAny function like this:

public function viewAny(User|Admin $user)