title: Laravel 4: custom login and check password
body: <p>I would like to customize my login in laravel 4 where <code>username</code> is either his <code>username</code> or <code>email</code> so what I did is:</p>
  
  <pre><code>public static function custom_login($uname,$pwd)
  {
      $res = DB::select("select * from users where (username = ? or email = ?) and password = ? and active = 1",array($uname,$uname,$pwd));
              return $res;
  }
  </code></pre>
  
  <p>Now, we all know that password are hashed so you cant use <code>password = ?</code>. how can I check the password if it's correct?</p>