Created
June 11, 2020 10:49
-
-
Save amardeep18/029b3b9077a4762497c325331c6e4c86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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