title: display Laravel validation errors with AJAX
body: <p>I have a <code>Form</code> in <code>Laravel</code> that submits with Ajax.every thing works well but the problem is that I can't render the validation's errors in HTML.<br> <strong>(I want to display the errors in <code>&lt;ul&gt;&lt;li&gt;</code> in my HTML)</strong></p>
  
  <blockquote>
    <p>Here is my Ajax request:</p>
  </blockquote>
  
  <pre><code> $(document).ready(function () {
          $("#submit").click(function (xhr) {
              xhr.preventDefault(),
                  $.ajax({
                      type: "POST",
                      contentType: "charset=utf-8",
                      dataType: 'json',
                      url: "{{route('messages.store')}}",
                      headers: {
                          "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
                      },
                      data: {
                          name: $("#name").val(),
                          email: $("#email").val(),
                          phone: $("#company").val(),
                          subject: $("#subject").val(),
                          message: $("#message").val()
                      },
                      success: function () {
                          alert('True');
                      },
                      error: function (xhr) {
                          console.log((xhr.responseJSON.errors));
                      }
                  }, "json")
          })
      });
  </code></pre>
  
  <blockquote>
    <p>Console logs:</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/GlieF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GlieF.png" alt="screenshot"></a></p>
  
  <p>Thanks for any help.</p>