Closed MallauryGerard closed 1 year ago
As far as I see, the documentation says to extend \Konekt\AppShell\Models\User
and not \Konekt\User\Models\User
:
Additionally, for variant 2, the usage of the HasRoles
trait is also mentioned:
But if you see an invalid reference in the documentation (which is possible of course) I would be grateful for a PR with the fix here: https://github.com/vanilophp/docs
Thank you! :pray:
Ok thanks! You're right.
I firstly extended "\Konekt\User\Models\User" and did not change it...
Yes, \Konekt\User\Models\User
is the "root" model; it wasn't far from the truth :wink:
Hello,
This command does not work if you follow the documentation. It is necessary to include the Trait "HasRoles" in the User model if we extend it with "\Konekt\User\Models\User".
Like this :
use HasApiTokens, HasFactory, Notifiable, HasRoles;
Otherwise, this error message appears :
Call to undefined method App\Models\User::assignRole()