title: Laravel 5.2 login always throws "These credentials do not match our records."
body: <p>I am trying to implement authentification using Laravel 5.2. I have been on this for hours, but I always get "These credentials do not match our records." when attempting to login.</p>
  
  <p>I have tried messing with the routes, adjusting password column size in users table, trying custom login validator etc. Just cannot get it to work.</p>
  
  <p><strong>This is how I made my users table via migration:</strong> </p>
  
  <p>Notes: </p>
  
  <ol>
  <li>I have to use raw statements for a school project.</li>
  <li>Laravel suggests password fields need to be 60 characters (tried even 100 already)</li>
  <li>Laravel requires 100 char column for remember_token</li>
  <li>Edit: The database and the users table were created successfully and user data gets saved on registration.</li>
  </ol>
  
  <p>Code:</p>
  
  <pre><code>    DB::statement("CREATE TABLE users(
        id INT PRIMARY KEY AUTO_INCREMENT,
        firstname VARCHAR(50) NOT NULL,
        lastname VARCHAR(50) NOT NULL,
        password VARCHAR(60) NOT NULL,
        email VARCHAR(255) UNIQUE NOT NULL,
        bio VARCHAR(500),
        gender ENUM('F','M') NOT NULL,
        birthday DATE NOT NULL,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
        updated_at TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        level INT DEFAULT 0,
        remember_token VARCHAR(100)
      )");
  </code></pre>
  
  <p>Here is my login form:</p>
  
  <pre><code>&lt;form method="POST" action="login"&gt;
  {!! csrf_field() !!}
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;label for="email"&gt;E-mail: &lt;/label&gt;  &lt;/td&gt;
      &lt;td&gt;  &lt;input type="email" name="email" value="{{ old('email') }}"&gt;  &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;label for="password"&gt;Password: &lt;/label&gt;  &lt;/td&gt;
      &lt;td&gt; &lt;input type="password" name="password" id="password"&gt;  &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;label for="remember"&gt;Remember me: &lt;/label&gt;  &lt;/td&gt;
      &lt;td&gt; &lt;input type="checkbox" name="remember"&gt;  &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;div&gt;
      &lt;button type="submit"&gt;Login&lt;/button&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My routes:</p>
  
  <pre><code>Route::group(['middleware' =&gt; ['web']], function () {
    Route::get('registration', 'MainController@getRegister');
    Route::get('login', 'MainController@getLogin');
    Route::get('logout', 'Auth\AuthController@logout');
    Route::post('registration', 'Auth\AuthController@postRegister');
    Route::post('login', 'Auth\AuthController@postLogin');
  });
  
  Route::group(['middleware' =&gt; ['auth','web']], function () {
    Route::get('/', 'MainController@getIndex');
  });
  </code></pre>
  
  <p><code>AuthController</code> class:</p>
  
  <pre><code>class AuthController extends Controller
  {
      use AuthenticatesAndRegistersUsers, ThrottlesLogins;
  
      /**
       * Where to redirect users after login / registration.
       *
       * @var string
       */
       protected $redirectTo = '/';
       protected $loginPath = 'login';
  
      /**
       * Create a new authentication controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('web', ['except' =&gt; 'logout']);
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'firstname' =&gt; 'required|max:50',
              'lastname' =&gt; 'required|max:50',
              'email' =&gt; 'required|email|max:255|unique:users',
              'password' =&gt; 'required|confirmed|min:6',
              'birthday' =&gt; 'required',
              'gender' =&gt; 'required'
          ]);
      }
  
  
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return User
       */
      protected function create(array $data)
      {
          return User::create([
              'firstname' =&gt; $data['firstname'],
              'lastname' =&gt; $data['lastname'],
              'birthday' =&gt; $data['birthday'],
              'gender' =&gt; $data['gender'],
              'email' =&gt; $data['email'],
              'password' =&gt; bcrypt($data['password']),
          ]);
      }
  
      protected function logout(){
        if (Auth::check()){
          Auth::logout();
        }
        return redirect('login');
      }
  }
  </code></pre>