title: Laravel Three State Login Attempt
body: <p>As default Laravel Login attempt method returns bool but I want to modify it and getting another result if user exists but user's status is passive.
  I do not want to change any code in laravel vendor directory. I can write my own login method in LoginController like <code>AuthenticatesUsers::login()</code> easily but the problem is <code>SessionGuard::attempt()</code> has own lifecycle, it is not a trait that LoginController uses it. </p>
  
  <p>Following is original version of <code>SessionGuard::attempt()</code> method.</p>
  
  <pre><code>public function attempt(array $credentials = [], $remember = false, $login = false)
  {
      $this-&gt;fireAttemptEvent($credentials, $remember, $login);
  
      $this-&gt;lastAttempted = $user = $this-&gt;provider-&gt;retrieveByCredentials($credentials);
  
      // If an implementation of UserInterface was returned, we'll ask the provider
      // to validate the user against the given credentials, and if they are in
      // fact valid we'll log the users into the application and return true.
      if ($this-&gt;hasValidCredentials($user, $credentials)) {
  
          if ($login) {
              $this-&gt;login($user, $remember);
          }
  
          return true;
      }
  
      // If the authentication attempt fails we will fire an event so that the user
      // may be notified of any suspicious attempts to access their account from
      // an unrecognized user. A developer may listen to this event as needed.
      if ($login) {
          $this-&gt;fireFailedEvent($user, $credentials);
      }
  
      return false;
  }
  </code></pre>
  
  <p>Note: </p>
  
  <pre><code>$credentials = [
              'email' =&gt; $request-&gt;input('email'),
              'password' =&gt; $request-&gt;input('password'),
              'status_id' =&gt; 1
             ];
  </code></pre>
  
  <p>But I want to remove status_id field and I want to show message to users if user's status_id is not 1.</p>
  
  <p>Basically I just want to override <code>SessionGuard::attempt()</code> method, something like this.</p>
  
  <pre><code>public function attempt(array $credentials = [], $remember = false, $login = false)
  {
      $this-&gt;fireAttemptEvent($credentials, $remember, $login);
  
      $this-&gt;lastAttempted = $user = $this-&gt;provider-&gt;retrieveByCredentials($credentials);
  
      // If an implementation of UserInterface was returned, we'll ask the provider
      // to validate the user against the given credentials, and if they are in
      // fact valid we'll log the users into the application and return true.
      if ($this-&gt;hasValidCredentials($user, $credentials)) {
          //User exists but user's status_id is not 1
          if($user-&gt;status_id != 1)
              return 2; // 2 for passive accounts
          if ($login) {
              $this-&gt;login($user, $remember);
          }
  
          return 1; //for active accounts
      }
  
      // If the authentication attempt fails we will fire an event so that the user
      // may be notified of any suspicious attempts to access their account from
      // an unrecognized user. A developer may listen to this event as needed.
      if ($login) {
          $this-&gt;fireFailedEvent($user, $credentials);
      }
  
      return 0; // for non exists acounts
  }
  </code></pre>
  
  <p>How can I achive this?</p>