Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amardeep18/029b3b9077a4762497c325331c6e4c86 to your computer and use it in GitHub Desktop.
Save amardeep18/029b3b9077a4762497c325331c6e4c86 to your computer and use it in GitHub Desktop.
<?
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check() && Auth::user()->role_id == 1) {
return redirect()->route('admin.dashboard');
} elseif(Auth::guard($guard)->check() && Auth::user()->role_id == 2){
return redirect()->route('user.dashboard');
} else {
return $next($request);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment