laravel return all the admin users code example
Example: get user with role laravel
$students = User::whereHas(
'roles', function($q){
$q->where('name', 'Teacher');
}
)->get();
$students = User::whereHas(
'roles', function($q){
$q->where('name', 'Teacher');
}
)->get();