Open
Description
requiredIf
requiredUnless
requiredWith
requiredWithAll
requiredWithout
requiredWithoutAll
比如注册表单中的手机号和邮箱,选填其一。
该如何设置必填项?下面这种可以吗?
['email', 'requiredWithoutAll', ['phone']],
['email', "string:6,50", 'filter' => $filter],
['email', 'email'],
['phone', 'requiredWithoutAll', ['email']],
['phone', "fixedSize:11", 'filter' => $filter],
['phone', 'regexp', "{$regexp['phone']}"],
这种感觉提示结果不是预期想要的二选一提示。
只会提示最后一个被验证的字段提示