I am trying to get it by same way i am getting the list of users with a certain Permission, but with role it's not working throwing me
Call to undefined method Spatie\Permission\Models\Role::roles()
The way i get list of users with a certain role:
$permission = $request->permission;
$usersWithPerms = User::permission($permission)->get();
return array("usersWithPerms"=>$usersWithPerms);
The way im trying to get roles with a certain permission:
$groupsWithPerms = Role::permission('perms_givePermToRole')->get();
return array("groupsWithPerms"=>$groupsWithPerms);
BadMethodCallException Call to undefined method Spatie\Permission\Models\Role::roles()