【发布时间】:2018-01-15 14:02:27
【问题描述】:
我需要使用图像和标签验证请求。如何为标签返回常见的验证错误消息。
$this->validate($request, [
'image' => 'required|image,
'tags.*' => 'string'
]);
当前消息是。
{
"image": [
"The image field is required."
],
"tags.0": [
"The tags.0 must be a string."
],
"tags.1": [
"The tags.1 must be a string."
]
}
预期的消息是。
{
"image": [
"The image field is required."
],
"tags": [
"The tags must be a string."
]
}
【问题讨论】:
标签: laravel validation laravel-5 laravel-validation