title: Laravel user auth using existing database table
body: <p>I have laravel 5.2 project and need to add Authentication, but I need to connect it to my table, that has Username and Password, also change default email/password to username/password. Also in my table passwords are not crypted.  </p>
  
  <p>I have change login.blade.php file from email field to username. </p>
  
  <p>Also change user.php model:</p>
  
  <pre><code> protected $table = 'LoginTable';
  </code></pre>
  
  <p>Also change AuthController.php. Add this:</p>
  
  <pre><code> protected $username = 'username';
  </code></pre>
  
  <p>and change validator and create methods:</p>
  
  <pre><code> return Validator::make($data, [
          'username' =&gt; 'required|max:255',
          'password' =&gt; 'required|min:6|confirmed',
      ]);
   return User::create([
          'username' =&gt; $data['username'],
          'password' =&gt; bcrypt($data['password']),
      ]);
  </code></pre>
  
  <p>But I cant login.It's saying 'These credentials do not match our records.'.
  How can I check what is the problem? Can anyone help me with this issue?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have change password to hashed password, but still cant make auth work.It is still saying:
  These credentials do not match our records.</p>
  
  <p>I want to mention that in Database I have only username and password, and dont have name and email.</p>