. I have used this way but it's not working. Is there any way to redirect user by using middleware
public function redirectTo() { $role = Auth::user()->role_id; switch ($role) { case '1': return redirect(route('dashboard')); break; case '2': return redirect(route('judge_dashboard')); case '3': return redirect(route('user_dashboard')); default: return '/login'; break; } }
Hello, sorry I missed your comment, have you resolved it? you can still reach out to me, if you have not
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
. I have used this way but it's not working. Is there any way to redirect user by using middleware
public function redirectTo()
{
$role = Auth::user()->role_id;
switch ($role) {
case '1':
return redirect(route('dashboard'));
break;
case '2':
return redirect(route('judge_dashboard'));
case '3':
return redirect(route('user_dashboard'));
default:
return '/login';
break;
}
}
Hello, sorry I missed your comment, have you resolved it? you can still reach out to me, if you have not