I'd recommend taking a look at and using one of these packages:
Oct 21, 2019
4
Level 1
Roles in Laravel 6?
Hello!
I'm learning how to use Laravel right now and I have a problem with user roles.
Basically I'd like to show/hide certain links and buttons based on the user role. (The users don't register on my web app however, I'd have to use an existing log-in service).
Should I just use "if" statements that check if a user has a specific role or is there a better way? Are there security concerns if I do it with "if" statements? Also, how would I test this? Is there a way I can give me a specific role without an corresponding account?
best regards
Please or to participate in this conversation.