chiiya / filament-access-control

Admin user, role and permission management for Laravel Filament
MIT License
192 stars 24 forks source link

Argument #1 ($user) must be of type FilamentUser #12

Closed imrancoder closed 1 year ago

imrancoder commented 2 years ago

Chiiya\FilamentAccessControl\Policies\FilamentUserPolicy::viewAny(): Argument #1 ($user) must be of type Chiiya\FilamentAccessControl\Models\FilamentUser, App\Models\User given, called in

i have already updated filament config file auth.pages.login value with \Chiiya\FilamentAccessControl\Http\Livewire\Login::class

chiiya commented 2 years ago

Did you update the guard as well?

'auth' => [
    'guard' => env('FILAMENT_AUTH_GUARD', 'filament'),

Make sure that you're not overwriting FILAMENT_AUTH_GUARD with a different value.

coder36 commented 1 year ago

I'm getting the same issue.

image image
coder36 commented 1 year ago

Managed to get in. I needed to update the policies to use FilamentUser:

image
chiiya commented 1 year ago

Closing due to inactivity.

Make sure you use FilamentUser in your policies and update your guard correctly.