Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete documentation for : php artisan make:superuser #5

Closed
MallauryGerard opened this issue Feb 25, 2023 · 3 comments
Closed

Incomplete documentation for : php artisan make:superuser #5

MallauryGerard opened this issue Feb 25, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@MallauryGerard
Copy link

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
Copy link
Member

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! 🙏

@fulopattila122 fulopattila122 added the documentation Improvements or additions to documentation label Feb 25, 2023
@fulopattila122 fulopattila122 self-assigned this Feb 25, 2023
@MallauryGerard
Copy link
Author

Ok thanks! You're right.

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

@fulopattila122
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants