title: Laravel: User registration validation error by Ajax
body: <p>I'm using <code>Ajax</code> for <code>Laravel</code> default <code>registration</code> process.</p>
  
  <p>My form is posting successfully. It works fine. But I can't show <code>Validation</code> error message by Ajax.</p>
  
  <p>For example: <code>email</code> of <code>users</code> should be unique. If I don't use <code>Ajax</code>. This validation error shows after refreshing page. But in <code>Ajax</code> mode, I want to show this error without page refresh.</p>
  
  <p>This is my <code>JS</code> code:</p>
  
  <pre><code>$.ajax({
      url: form.action,
      type: form.method,
      data: $(form).serialize(),
  
      beforeSend: function(){
          $('.reg-overlay').show();
      },
      success: function(response){
          location.reload();
      },
      error: function(response){
          console.log(response.responseText);
          var errObj=jQuery.parseJSON(response.responseText);
  
          // if(errObj.email)
          //  $('#user-reg-email-err-msg').html(errIcon+' '+errObj.email);
          // if(errObj.roll_no)
          //  $('#user-reg-roll-err-msg').html(errIcon+' '.errObj.roll_no);
  
          alert(errObj.email); // It appears 'undefined'
      },
      complete: function(){
          $('.reg-overlay').hide();
      }
  });
  </code></pre>
  
  <p>Here <code>alert(errObj.email);</code> shows <code>undefined</code>.
  How to fix it?</p>