title: Check for active user state with laravel
body: <p>This is pretty standard login function and validation that works nicely. But I also want to check that the user is active. I have set up a column in my users table with 'active' set to either 0 or 1.</p>
  
  <pre><code>public function post_login() 
  {
      $input = Input::all();
  
      $rules = array(
          'email' =&gt; 'required|email',
          'password' =&gt; 'required',
      );  
  
      $validation = Validator::make($input, $rules);
  
      if ($validation-&gt;fails())
      {
          return Redirect::to_route('login_user')
              -&gt;with_errors($validation-&gt;errors)-&gt;with_input();
      }
  
      $credentials = array(
          'username' =&gt; $input['email'],
          'password' =&gt; $input['password'],
      );
  
      if (Auth::attempt($credentials)) 
      {
          // Set remember me cookie if the user checks the box
          $remember = Input::get('remember');
          if ( !empty($remember) )
          {
              Auth::login(Auth::user()-&gt;id, true);
          }
  
          return Redirect::home();
  
      } else {
          return Redirect::to_route('login_user')
              -&gt;with('login_errors', true);
      }
  }
  </code></pre>
  
  <p>I've tried something like this already:</p>
  
  <pre><code>$is_active = Auth::user()-&gt;active;
  
  if (!$is_active == 1)
  {
      echo "Account not activated";
  }
  </code></pre>
  
  <p>But this can only be used within the 'auth attempt' if statement and at that point the users credentials(email and pass) are already validated. So even if the users account if not active at this point they are already logged in. </p>
  
  <p>I need a way to return validation to let them know they still need to activate their account and check if their account is set at the same time their email and pass are being checked.</p>