It isn't a duplication. the message is the main message error or the first one (as far as I know). The errors is an object with more details about each input and its error.
You can notice the difference if you get multiple inputs with errors.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I recently upgraded to Laravel 10 and am now noticing on form submission the validator is returning pseudo duplicate error messages in the form of a messages and errors property. When before only the errors property was sent.
Calling the validator in the controller:
$this->getBookingValidator($request)->validate();
The Validator itself:
protected function getBookingValidator(Request $request): \Illuminate\Contracts\Validation\Validator
{
return Validator::make($request->all(), [
'name' => 'required',
'started_at' => 'required',
'ended_at' => 'required|after_or_equal:started_at',
]);
}
Response:
{"message":"The ended at must be a date after or equal to started at.","errors":{"ended_at":["The ended at must be a date after or equal to started at."]}}
So on the F/E it's showing an undesirable "duplication", this is occurring across all validators and all controllers. I did go from Laravel 8 to 10 while skipping 9, does this remind anyone of anything?
I do notice the documentation is updated with (can't link on first day of sign up) but under validation and Validation Error Response Format it shows the json object I link above. Which makes me believe this is intended behaviour?
Thanks for any help.
Please or to participate in this conversation.