Level 27
Not sure I understand you correctly, but if you want to get only certain roles you can remove the ones you don't want using whereNotIn() for example.
Role::whereNotIn('name', ['admin', 'whatever'])->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone I have designed a system that the user, when he wants to edit his information, Specify your access level In the edit form I have called the roles like this
$roles = Role::all()
But in this case, the user can admin himself
How can I specify when calling roles what roles are not displayed to the user that are not selectable, for example Admin Roles - Managing Comments - Managing User Permissions
Please or to participate in this conversation.