how to get the users with certain roles in laravle 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();