Skip to content

web / api roles and permissions headache! #2421

Answered by drbyte
tomekkicaj700 asked this question in Q&A
Discussion options

You must be logged in to vote

$role = Role::findByName(Roles::ADMIN, 'api');

$user->assignRole($role);

Edit: I think you have to pass an attributes array to findByName...

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@tomekkicaj700
Comment options

@parallels999
Comment options

@drbyte
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@drbyte
Comment options

Answer selected by tomekkicaj700
@tomekkicaj700
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants