title: How to compare Laravel's hash password using a custom login form?
body: <p>Can you help me with this? I am building my own login form using Laravel. But I have a problem because I stored my password using Hash method and in my login form I used hash method again to compare. But I found out that the hash value is always changing. </p>
  
  <p>Here's my code in routes:</p>
  
  <pre><code>Route::post('/admin_handle_login', function()
  {
  
      $rules = array(
          'admin_username'    =&gt;  'required',
          'admin_password'    =&gt;  'required'
      );
  
      $validate_admin_login = Validator::make(Input::all(), $rules);
  
      if($validate_admin_login-&gt;fails()) {
  
          $messages = $validate_admin_login-&gt;messages();
  
          Session::flash('warning_notification','Error: Incomplete details!');
  
          return Redirect::to('/flaxadmin')
                              -&gt;withErrors($messages)
                              -&gt;withInput(Input::except('admin_password'));
  
      } else {
  
          $d = array(
              Input::get('admin_username'), Hash::make(Input::get('admin_password'))
          );
  
          $validate_admin = DB::table('administrators')
                              -&gt;select('username')
                              -&gt;where('username', Input::get('admin_username'))
                              -&gt;where('password', Hash::check('password', Input::get('admin_password')))
                              -&gt;count();
          fp($d);
          fp($validate_admin);
  
      }
  
  });
  </code></pre>
  
  <p>The result is</p>
  
  <pre><code>Array
  (
      [0] =&gt; admin002
      [1] =&gt; $2y$10$RTwKHN9W1/unu1ZhYlNjauApJjjoNTBnE6td/AZ5jWgZEdqVav0um
  )
  0
  </code></pre>
  
  <p>In my database the password of admin002 is</p>
  
  <pre><code>$2y$10$47sSXLzh/YXN6Rf2fmljYO7lZaxfhXVSUTp5bssR2gYQ6Nw9luUH2
  </code></pre>
  
  <p>Is my code wrong? Or are there any proper way to do this? I am a begiiner in Laravel..</p>