After updating from L5.1 to L5.2, I no longer receive a JSON object as response on a failed FormRequest (i.e. on an AJAX post request).
Usually I would receive a 422 response like:
[
email: 'E-mail is invalid',
firstname: 'Firstname must be at least 2 characters'
]
But now I receive a 500 error page:
I have ensured that my AJAX calls have application/json as Accept header.
Update
And no, I am not manually catching this exception. I am using the default FormRequest that Laravel provides. As they state in documentation: When using the validate method during an AJAX request, Laravel will not generate a redirect response. Instead, Laravel generates a JSON response containing all of the validation errors. This JSON response will be sent with a 422 HTTP status code.
Like so: php artisan make:request StoreBlogPostRequest (https://laravel.com/docs/5.1/validation#form-request-validation)

HttpResponseException?? - MarabocFormRequestthat Laravel provides. As they state in documentation:When using the validate method during an AJAX request, Laravel will not generate a redirect response. Instead, Laravel generates a JSON response containing all of the validation errors. This JSON response will be sent with a 422 HTTP status code.laravel.com/docs/master/… - FooBarapp/Exceptions/Handler.phpmatches 5.2's to start with. - ceejayozapp/Exceptions/Handler.phpand was overriding therenderandrenderHttpExceptionfunctions in Illuminate\Foundation\Exceptions\Handler. For Laravel 5.2, the parent functions have changes to handle ValidatesRequests and HttpResponseException. So, I refactored my code to better depend on the parent functions. All working great again now. - casafred