app/Http/Middleware/Authenticate.php
/**
     * Get the path the user should be redirected to when they are not authenticated.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return string
     */
Get the path the user should be redirected to when they are not authenticated.
@param  \Illuminate\Http\Request  $request
@return string
Get the path the user should be redirected to when they are not authenticated . @param \ Illuminate \ Http \ Request $request @return string
public function handle($request, Closure $next, $guard = 'web')
    {
        if (Auth::guard($guard)->guest()) {
            switch ($guard) {
                case 'admin':
                    return redirect("/admin/login");
                default:
                    return redirect("/login");
            }
        }
        return $next($request);
    }
public function handle ( $ request , Closure $ next , $ guard = 'web' ) { if ( Auth :: guard ( $ guard ) -> guest ( ) ) { switch ( $ guard ) { case 'admin' : return redirect ( " /admin/login " ) ; default : return redirect ( " /login " ) ; } } return $ next ( $ request ) ; }
Get the path the user should be redirected to when they are not authenticated.
Get the path the user should be redirected to when they are not authenticated .