Can't get all Users have Roles #1842
Unanswered
newgoldenman
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Are you using the trait like documentation says? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I've installed and i am using this very nice package.
everything is ok.
i use it on laravel 8.
I Can Do Everything such as create or delete Roles or Permissions. These are OK.
BUT
I have a big problem:
i cant get ALL USERS have a specific Role for example: 'writer':
$users = User::role('writer')->get(); // Returns only users with the role 'writer'
This code wont work for me.
The error is:
and on phpStorm this error is:
method 'role' not found in Illuminate\Foundation\Auth\User
Please help me.
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions