phpsa / filament-authentication

MIT License
112 stars 24 forks source link

Asking for a "roles" relationship in the users model #4

Closed sivierostein closed 2 years ago

sivierostein commented 2 years ago

I installed filament over a fresh install of laravel Jetstream. Installed the filament-authentication plugin as oriented in readme... When I try to access Users resource in the admin panel, I am receiving this message:

Call to undefined relationship [roles] on model [App\Models\User].

Is there any other package I need to install ?

Thanks in advance. Rodolfo

PS: I create a roles function in User.php returning an empty array []. And now, the error is: Call to a member function addEagerConstraints() on array

phpsa commented 2 years ago

Spatie roles and permissions has a few steps, adding the trait to the user model should sort. Will update the docs soon

phpsa commented 2 years ago

Thank you for the report: I have updated the documentation now: please follow the steps at: https://github.com/phpsa/filament-authentication#additional-resources for both roles&permissions and impersonate