Dec 6, 2017
0
Level 4
Multi Auth not displaying my whoops page
Am doing a multi auth with laravel 5.5. The admin middleware works fine but when I get an error the error page (whoops) does not display.
This is my Handler.php
public function render($request, Exception $exception)
{
$guard = array_get($exception->guards(), 0);
switch ($guard) {
case 'admin':
$login = 'admin.login';
return redirect()->guest(route($login));
default:
return parent::render($request, $exception);
}
// return parent::render($request, $exception);
}
This is my RedirectIfAuthenticated Middleware
public function handle($request, Closure $next, $guard = null)
{
switch ($guard) {
case 'admin':
if (Auth::guard($guard)->check()) {
return redirect()->route('admin.dashboard');
}
break;
default:
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
break;
}
return $next($request);
}
Please or to participate in this conversation.