I've custom validation code:
$this->validate($request, [
'array' => 'required|array|max:100',
'array.*' => 'required|string|distinct|min:3'
], [
'array.max' => 'Array can't have more :max items',
]);
Here how I can add cusom message with array items rule?
For example: 'array.item.min' => 'Array items length can't be greater :min charackters'
Example laravel default validation error message for array items:
{
message: "The given data was invalid."
}
errors: {
array.3: ["The array.3 must be at least 3 characters."]
}
array.3: ["The array.3 must be at least 3 characters."]
0: "The array.3 must be at least 3 characters."
message: "The given data was invalid."
How I can replace this validation message with my single message for array items?
array.*.min?