title: Laravel 5 user can not be retrieved after successful authentication
body: <p>I am using Laravel 5.1 and trying to implement user authentication. Basically no routes should be accessible without loggin in.
  The built in trait (<code>AuthenticatesAndRegistersUsers</code>) does not work correctly since, after a successful authentication, the redirected controller will not be able to pull out the user via <code>Auth::user()</code> or <code>$this-&gt;auth-&gt;user</code> or <code>$request-&gt;user()</code>.</p>
  
  <p>I did verify that it is a successful attempt by var-dumping the user right after <code>$this-&gt;auth-&gt;attempt()</code>.</p>
  
  <p>However after the redirect with <code>return redirect()-&gt;intended(...)</code>, no user can be pulled.</p>
  
  <p>I am now trying to implement it by skipping the <code>AuthenticatesAndRegistersUsers</code> and writing it directly in the <code>AuthController</code> but again encountering the same problem.</p>
  
  <p>This is the part in <code>AuthController</code> that does the validation:</p>
  
  <pre><code>$this-&gt;validate($request, [
      'email'    =&gt; 'required|email',
      'password' =&gt; 'required',
  ]);
  
  $credentials = $request-&gt;only('email', 'password');
  
  //attempt to authenticate
  //if successful, redirect to the intended url or the default redirectPath
  if ($this-&gt;auth-&gt;attempt($credentials, $request-&gt;has('remember')))
  {
      //when I do dd($this-&gt;auth-&gt;user()) here it shows the correct user record
      return redirect()-&gt;intended($this-&gt;redirectPath);
  }
  </code></pre>
  
  <p>It redirects to the correct url (<code>HomeController</code>) but then the user can not be retrieved (within the <code>show</code> method or any other method):</p>
  
  <pre><code>dd(Auth::user()); //null
  dd(Auth::check());//null
  </code></pre>
  
  <p><code>HomeController</code> extends my <code>BaseController</code> which uses the <code>auth</code> middleware</p>
  
  <pre><code>public function __construct()
  {
      $this-&gt;middleware('auth');
  }
  </code></pre>
  
  <p>I had Laravel 4 custom authentication and it was all working fine, I'm still new to the middleware authentication concept in Laravel 5.</p>
  
  <p>Any help would be appreciated.</p>