I need to validate form data with Respect. At least one of these fields must have a value: $vfname
and $vlname
. After some trial and error, I found that I can concatenate and test with notEmpty()
:
v::StringType()->notEmpty()->assert($vfname . $vlname)
But this seems really hacky. Is there a better way to validate so that at least one of these fields has a value?