title: How to print laravel's 5.5's validation response in in axios
body: <p>My code was working on laravel 5.4 and when upgraded it is not working. I then tried to see the returned response object in the network. </p>
  
  <p>This is what I see </p>
  
  <pre><code>{message: "The given data was invalid.",…}
    errors:{userName: ["The user name has already been taken."], email: ["The 
       email has already been taken."]}
  </code></pre>
  
  <p>In my axios I am trying to console the message "The user name has already been taken" and "The email has already been taken."</p>
  
  <p>But I shows undefined. Here is my code. </p>
  
  <pre><code>.catch(function (error) {
         // This shows undefined. 
         console.log(error.errors]);
    });
  </code></pre>
  
  <p><strong>Full object</strong></p>
  
  <pre><code>{
  "message": "The given data was invalid.",
  "errors": {
      "userName": [
          "The user name field is required."
      ],
      "email": [
          "Email is required!"
      ],
      "password": [
          "The password field is required."
      ],
      "lastName": [
          "The last name field is required."
      ],
      "userType": [
          "The user type field is required."
      ]
  } 
  }
  </code></pre>