SlimValidation
SlimValidation copied to clipboard
Validation of *oneOf*
Hi,
is there any way to validate with oneOf from the Respect validation package?
v::oneOf(
v::key('ip', v::notBlank()),
v::key('q', v::notBlank()->alpha()
)
Of course this works but does not contain validation messages like the validator method.
I'd like to pass this to the validator to get the error messages in case there are some.
$validator = $this->validator->validate($request, [
'ip' => v::optional(v::ip()),
'country' => v::optional(v::countryCode())->in($this->country_codes),
v::oneOf(
v::key('ip', v::notBlank()),
v::key('q', v::notBlank()->alpha())
)
]);
Thanks