jeudi 24 août 2017

required_without not working with other rules

'person.mail' =>'required_without:person.phone|sometimes|email|unique:persons,mail',

'person.phone' => 'required_without:person.mail|sometimes|http://regex:/[0-9]/|size:10|unique:persons,phone'

i need to validate phone and mail, one of them is mandatory

when the mail is empty and the phone isn't, the validation fails at the email rule and this goes both ways, when the mail is present and phone empty, it fails at the regex rule

how can i stop validation if value is null?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire