Home > Blockchain >  I receive an id of a Role and with that id I list all the permissions that are assigned to that role
I receive an id of a Role and with that id I list all the permissions that are assigned to that role

Time:09-05

Good Evening, it is possible that in SPATIE-LARAVEL-PERMISSION the following:

Some function or way that I receive an id of a Role and with that id I list all the permissions that are assigned to that role. I'm looking but I didn't find an answer. sorry for the inconvenience thank you

CodePudding user response:

As described here in the docs, you can get all permissions of a role with the permissions relation

use \Spatie\Permission\Models\Role;

Role::find($id)->permissions;
  • Related