title: Laravel 7 custom login
body: <p>I'm making a custom login in Laravel, and when I try to check login form's data I cannot log in. In register I hash the password to store it in db, so the login form's password field will never be equal to stored db.</p>
  <p>Here's my create function, where I register the user:</p>
  <pre><code>   public function create()
  {
      $this-&gt;validateFields();
  
      if (request('profileImage') !== null) {
          $this-&gt;storeImage();
  
          User::create([
              'username' =&gt; request('username'),
              'email' =&gt; request('email'),
              'password' =&gt; Hash::make('password'),
              'profileImage' =&gt; request()-&gt;profileImage-&gt;getClientOriginalName(),
          ]);
  
      }
  
  
      User::create([
          'username' =&gt; request('username'),
          'email' =&gt; request('email'),
          'password' =&gt; Hash::make(request('password')),
      ]);
  
  
      return Redirect::to(route('user.showLoginForm'));
  
  }
  </code></pre>
  <p>validateFields and storeImage are not relevant for the question...</p>
  <p>Here's my login function:</p>
  <pre><code>    public function login()
  {
      request()-&gt;validate([
          'email' =&gt; 'required',
          'password' =&gt; 'required'
      ]);
  
      $credentials = array(
          &quot;email&quot; =&gt; request(&quot;email&quot;),
          &quot;password&quot; =&gt; bcrypt(request(&quot;password&quot;))
      );
  
      if (Auth::attempt($credentials)) {
          return 'exit!';
      }
  
      return 'Error';
  
  }
  </code></pre>
  <p>Here's my login form:</p>
  <pre><code>  &lt;div class=&quot;container&quot;&gt;
  
      &lt;div class=&quot;row pt-2&quot;&gt;
          &lt;div class=&quot;col-sm-12 justify-content-center&quot;&gt;
              &lt;div class=&quot;card&quot;&gt;
                  &lt;div class=&quot;card-header&quot;&gt;
                      &lt;h4&gt;
                          Login
                      &lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;card-body&quot;&gt;
  
                      &lt;div class=&quot;form-group&quot;&gt;
                          &lt;form action=&quot;{{ route('user.login') }}&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
                              @csrf
  
                              &lt;div class=&quot;form-group row&quot;&gt;
                                  &lt;div class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;
                                      &lt;label for=&quot;email&quot;&gt;{{ __('E-mail') }}&lt;/label&gt;
                                  &lt;/div&gt;
                                  &lt;div class=&quot;col-md-6&quot;&gt;
                                      &lt;input type=&quot;email&quot; name=&quot;email&quot; id=&quot;email&quot; class=&quot;form-control&quot;&gt;
                                  &lt;/div&gt;
  
                              &lt;/div&gt;
  
                              &lt;div class=&quot;form-group row&quot;&gt;
                                  &lt;div class=&quot;col-md-4 col-form-label text-md-right&quot;&gt;
                                      &lt;label for=&quot;password&quot;&gt;Contraseña&lt;/label&gt;
                                  &lt;/div&gt;
                                  &lt;div class=&quot;col-md-6&quot;&gt;
                                      &lt;input type=&quot;password&quot; name=&quot;password&quot; id=&quot;password&quot; class=&quot;form-control&quot;&gt;
                                  &lt;/div&gt;
  
                              &lt;/div&gt;
  
                              &lt;div class=&quot;form-group row&quot;&gt;
                                  &lt;div class=&quot;col-md-6 col-form-label text-md-right&quot;&gt;
                                      &lt;button type=&quot;submit&quot; class=&quot;btn btn-outline-elegant&quot;&gt;Iniciar sesión&lt;/button&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
  
                          &lt;/form&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>