1. Submit the form through ajax. If the verification fails, a json with an http status value of 422 will be returned.
2. How to customize the format of the json?
3. The http status value is 422, which seems to have been hard-coded in the framework. I want to return custom json to the front end by catching validation exceptions. Is this possible?
4. When using the ajax method of jquery, you still cannot get the return data formatted as a json object when an error occurs. You can only get a json in the form of a string
You can define the json format by yourself according to your needs. There is nothing more to say about the next two questions
The http status value is 422, which seems to be hard-coded in the framework. I want to return custom json to the front end by catching validation exceptions. Is this possible?
Using jquery's ajax method, when an error occurs, you still cannot get the return data formatted as a json object, you can only get a json in the form of a string