Support the ongoing development of Laravel.io →
posted 7 years ago

Hey Guys, I am using ajax to send to post a form. I am using the $this->validate($request, [rules here]); which should return a JSON response if there is something that didn't validate correctly.

If I go to the network tab in Firefox debugger it shows me the response that laravel is throwing. Here is a picture: Firefox Debugger

error: function( data ){
  var errors = data.responseJSON;
  console.log(errors);
}

This is returning undefined in the console. Any ideas on what im doing wrong? I am using this on my site for something else and it works fine. The data.responseJSON seems to not be working right.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.