title: Tracing the authenticated() method in the default laravel auth functionality
body: <p>I am currently using this method to provide a flash message to a user after a user logged in. This is using the default auth functionality of <code>laravel(5.1)</code>. </p>
  
  <p>Somebody suggested my to use this method in my <code>AuthController</code> to override the default one. </p>
  
  <pre><code>    public function authenticated(Request $request, User $user ) {
          // Succes flash message
          alert()-&gt;success('Succesvol ingelogd', 'Welkom');
  
          return redirect()-&gt;intended( $this-&gt;redirectPath() );
      }
  </code></pre>
  
  <p>The only problem is that I can not exactly figure out where this method comes from. Once a user logs in, the user will post his data to the <strong>postLogin</strong> method on the <strong>AuthenticatesUsers</strong> trait. If the auth attempt is successful this method calls the <strong>handleUserWasAuthenticated</strong>.</p>
  
  <p>This method calls the the authenticated method like so:</p>
  
  <pre><code>    protected function handleUserWasAuthenticated(Request $request, $throttles)
      {
          if ($throttles) {
              $this-&gt;clearLoginAttempts($request);
          }
  
          if (method_exists($this, 'authenticated')) {
              return $this-&gt;authenticated($request, Auth::user());
          }
  
          return redirect()-&gt;intended($this-&gt;redirectPath());
      }
  </code></pre>
  
  <p>I can not figure out where the <code>authenticated()</code> method is coming from though. Can somebody help me with figuring this out. I would like to understand more about this code so I don't have to constantly ask others for help with it.</p>