title: Laravel: Custom login redirects to /home instead of a /welcome page
body: <p>I am trying to create a custom login. After login, it lands to '/home' page instead of '/welcome' page.</p>
  
  <p>Here is my Login Controller :</p>
  
  <pre><code>class LoginController extends Controller
  {
      use AuthenticatesUsers;
  
      protected $redirectTo = '/welcome';
  
      public function __construct()
      {
          $this-&gt;middleware('guest')-&gt;except('logout');
      }
  
      public function view()
      {
          return view('auth.login');
      }
  
      public function login(Request $request)
      {
          $this-&gt;validate($request, [
                  'email'    =&gt; 'required',
                  'password' =&gt; 'required',
              ]);
  
          $loginValue = $request-&gt;input('email');
  
          $login_type = $this-&gt;getLoginType($loginValue);
  
          $request-&gt;merge([
              $login_type =&gt; $loginValue
          ]);
  
          if (auth()-&gt;attempt($request-&gt;only($login_type, 'password'))) {
              // return redirect()-&gt;intended($this-&gt;redirectPath());
              return redirect()-&gt;intended(route('welcome'));
          }
          return redirect()-&gt;back()-&gt;withInput()-&gt;withErrors([ 'email' =&gt; "These credentials do not match our records." ]);
      }
  
      public function getLoginType($loginValue)
      {
          return filter_var($loginValue, FILTER_VALIDATE_EMAIL ) ? 'email'
         : ( (preg_match('%^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \/]?)?((?:\(?\d{1,}\)?[\-\.\ \/]?){0,})(?:[\-\.\ \/]?(?:#|ext\.?|extension|x)[\-\.\ \/]?(\d+))?$%i', $loginValue)) ? 'mobile' : 'name' );
      }
  }
  </code></pre>
  
  <p>I have change the redirect path from Illuminate\Foundation\Exception\Handler.php :</p>
  
  <pre><code>protected function unauthenticated($request, AuthenticationException $exception)
  {
    return $request-&gt;expectsJson() ? response()-&gt;json(['message' =&gt; $exception-&gt;getMessage()], 401 : redirect('/');
  }
  </code></pre>
  
  <p>My routes file:</p>
  
  <pre><code>Route::get('/login', 'Auth\LoginController@view')-&gt;name('login');
  Route::post('/login', 'Auth\LoginController@login');
  </code></pre>