title: User can not login after registering on Laravel
body: <p>I am trying to set up authentication system on Laravel from scratch but I can not make the user to log in after the user its registered.</p>
  
  <p>My RegisterController to store the user:</p>
  
  <pre><code>public function store()
  {
  
      $this-&gt;validate(request(),[
          'name'=&gt;'required',
          'email'=&gt;'required',
          'password'=&gt;'required'
      ]);
  
     $user = User::create(request(['name', 'email','password']));
  
      auth()-&gt;login($user);
  
      return redirect()-&gt;home();
  }
  </code></pre>
  
  <p>Now everything works great but when i go to login form I cant log in. Here is my SessionsController that deals with login:</p>
  
  <pre><code>public function store()
  {
  
  if(!auth()-&gt;attempt(request(['email','password']))) 
  
      return back();
  }
   return redirect()-&gt;home();
  }
  </code></pre>
  
  <p>What I am doing wrong here that I can not log in the user?!</p>