title: Password confirmation in laravel
body: <p>I want to build a register form in laravel. My form has a password confirmation.
  In the view I have following code:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label for="password"&gt;Password&lt;/label&gt;
      &lt;input type="password" class="form-control" id="password" name="password"&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
        &lt;label for="password_confirmation"&gt;Confirm Password&lt;/label&gt;
        &lt;input type="password" class="form-control" id="password_confirmation" name="password"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And in the controller I have following code to validation:</p>
  
  <pre><code>$this-&gt;validate(request(), [
       'name' =&gt; 'required',
       'email' =&gt; 'required|email',
       'password' =&gt; 'required|confirmed',
   ]);
  </code></pre>
  
  <p>When I submit the form I get "The password confirmation does not match." error. What causes this error?
  Thanks in Advance.</p>