Am i missing something?
Why there's no mention of this in docs.
The functionality to list roles in order to apply one to the user is something so obvious that i suspect there must be a reason not to provide it.
Hi,
Please check the code below to see if the help.
Get all roles:
$roles = \Spatie\Permission\Models\Role::all();
Get all users with relations:
$users = \App\User::with('roles')->get();
Thank for answering this one @pmestre-pt 馃憤
Thanks a lot :dancer:
use App\Role;
Role::get();
coz Role model already extends \Spatie\Permission\Models\Role
Most helpful comment
Hi,
Please check the code below to see if the help.
Get all roles:
$roles = \Spatie\Permission\Models\Role::all();Get all users with relations:
$users = \App\User::with('roles')->get();