Level 102
$users = User::role('employee')->get();
If I recall correctly
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I have a really simple question and I am stuck on it. How can I get users that have only a specific role? i.e. I want to query users that have an "employee" role only but in general, they can have multiple roles. Example: User 1 - Employee - Accounts User 2 - Employee
In this example, I only want user 2.
Please or to participate in this conversation.