1
我遇到问题required_without_all
。我有三个元素,至少一个应该填充。我的文件输入名称是image[]
。添加一张图片但是仍然保留title
和body
仍然会导致验证错误,即使它不应该。Laravel 5.2 required_without_all请求问题
有关我在做什么错的任何想法?
public function rules()
{
return [
'title' => 'required_without_all:body,image.*',
'body' => 'required_without_all:title,image.*',
'image.*' => 'required_without_all:body,title',
];
}
public function messages()
{
return [
'title.required_without_all' => 'At least one field is required',
'body.required_without_all' => 'At least one field is required',
'image.*.required_without_all' => 'At least one field is required',
];
}