Error validation with nested array object data in laravel 5.7

Tram Ho

Explanation of the issue: When validating data is in the form of an array object, use a validation form with the rules below.

Suppose in the data array, on the 5th object there is a null key name. Instead of returning an error message with the key and value of , in laravel 5.7 it will return the value of the data array.

Specifically, you can view that issue here. A laravel contributer said that this is not a bug but a feature, so laravel still plays according to this logic, I don’t think so, my clients too , so I fixed it.

We just need to override the invalidJson function in the App Exceptions Handler class

Share the news now

Source : Viblo