title: Laravel Auth::attempt after writing credentials, redirects me to login
body: <p>After typing email and password it redirects to the login page and do not proceeds further.
  I have used 'Authenticated' middleware, a middleware that I customized.</p>
  <p><strong>Web.php</strong></p>
  <pre><code>Route::group(['middleware' =&gt; ['Authenticated']], function () {
  
      Route::get('/', [App\Http\Controllers\AuthenticationController::class, 'dashboard'])-&gt;name('dashboard');
  
  }
  </code></pre>
  <p><strong>Controller</strong></p>
  <pre><code>    $email = $request-&gt;email;
          $password = $request-&gt;password;
  
          $user = User::select('id', 'email', 'password')-&gt;where('email', '=', $email)-&gt;first();
  
          if ($user) {
              if (!Hash::check($password, $user-&gt;password)) {
                  return redirect()-&gt;back()-&gt;withInput()-&gt;with('error', 'Email and password do not match');
              } else {
                  $credentials = $request-&gt;only('email', 'password');
                  if (Auth::attempt($credentials)) {
  
                      return redirect()-&gt;intended(route('dashboard'));
                  }
              }
          } else {
              return redirect()-&gt;back()-&gt;with('error', 'Email does not exists');
          }
  
      }
  </code></pre>
  <p><strong>Middleware</strong></p>
  <pre><code>public function handle($request, Closure $next)
  {
  
      if (!Auth::check()) {
          return redirect()-&gt;guest('login');
      }
      else{
          return $next($request);
      }
  
  }
  </code></pre>