I need to validate a request with image and tags. How to return a common validation error message for tags.
$this->validate($request, [
'image' => 'required|image,
'tags.*' => 'string'
]);
Currecnt message is.
{
"image": [
"The image field is required."
],
"tags.0": [
"The tags.0 must be a string."
],
"tags.1": [
"The tags.1 must be a string."
]
}
Expected message is.
{
"image": [
"The image field is required."
],
"tags": [
"The tags must be a string."
]
}