vanilophp / admin

Vanilo Admin Module
MIT License
6 stars 2 forks source link

Incomplete documentation for : php artisan make:superuser #5

Closed MallauryGerard closed 1 year ago

MallauryGerard commented 1 year ago

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()

fulopattila122 commented 1 year ago

As far as I see, the documentation says to extend \Konekt\AppShell\Models\User and not \Konekt\User\Models\User:

image

Additionally, for variant 2, the usage of the HasRoles trait is also mentioned:

image

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:

MallauryGerard commented 1 year ago

Ok thanks! You're right.

I firstly extended "\Konekt\User\Models\User" and did not change it...

fulopattila122 commented 1 year ago

Yes, \Konekt\User\Models\User is the "root" model; it wasn't far from the truth :wink: