Laravel Validation one of two fields must be filled

required_without should work.

It means that the field is required if the other field is not present. If have more than two fields and only one is required, use required_without_all:foo,bar,...

$rules = array(
    'Email' => 'required_without:QQ',
    'QQ' => 'required_without:Email',
);

In the example above (given by lucasgeiter) you actually only need one of the conditions not both.

$rules = array(
    'Email' => 'required_without:QQ'
);

If you have both rules then filling neither in will result in TWO error messages being displayed. This way it will check that at least one field is filled in and will only display one error message if neither are filled.


Laravel >= 8.32 only support.

Both (mobile or email) are presented simultaneously -> through an error.

Both (mobile or email) is not present simultaneously -> through an error.

Allowed

Only one parameter can be allowed.

'email'  =>  [ 'prohibited_unless:mobile,null,','required_without:mobile','email', 'max:255', ],
'mobile' =>  [ 'prohibited_unless:email,null','required_without:email', 'digits_between:5,13', 'numeric' ],