Skip to content

Get user roles and its permissions #2187

Answered by erikn69
lucianobosco asked this question in Q&A
Discussion options

You must be logged in to vote

Maybe try

$this->load('roles.permissions');
///
'roles' => $this->roles->keyBy('name')->map(fn($role) => $role->permissions->pluck('name'))->toArray(),

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lucianobosco
Comment options

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