0
该问题非常类似于:Laravel: Apply validation rule only if the another one passed,但是该问题的答案是错误的。仅当上述验证通过时,Laravel验证才会继续进行下一个验证
$rules = array(
'file' => 'mimes:jpg,png,pdf,doc,docx',
'anotherFile' => 'validate_file'
);
我想运行仅file
验证通过anotherFile
验证。
Laravel可能吗?
我其实需要的是只收到1个错误,只有第一个错误。 – Coder
您的意思是使用'required_if:file'之类的东西来引用https://github.com/laravel/framework/pull/11986吗? –
@OmisakhOluwatobi是的 – Coder