laravel add roles to 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();