I am using FormRequest validation on a lot of my POST based routes.
All works fine, but I am wondering how (and if?) I can change the returned http status code from within the validation class?
For example
I have a request that validates if 2 properties are filled out (by using the required property).
If they are not provided, I get a 422 Unprocessable Entity.
I would like to change this to a 400
I believe you need to override the response() method.. Basically copy it to your form request file and change it to fit your needs.. For example, if you're using JSON, change the JsonResponse($errors, 422) to JsonResponse($errors, 400) ..