我有两个字段:Email和Telephone
我想创建一个验证,其中需要两个字段之一,并且如果设置了一个或两个字段,则它应该是正确的格式。
我尝试了这个,但它不起作用,但我需要两者
public static array $createValidationRules = [
'email' => 'required_without:telephone|email:rfc',
'telephone' => 'required_without:email|numeric|regex:/^\d{5,15}$/',
];
Run Code Online (Sandbox Code Playgroud)