Laravel required_without
is not working when I'm passing multiple fields.
This is my rules:
$rules = [
'startDate' => 'date|date_format:m/d/Y|required_without:customerId,purchaseId,orderId',
'endDate' => 'date|date_format:m/d/Y|required_without:customerId,purchaseId,orderId',
];
What I want, when I pass customerId
or purchaseId
or orderId
(but not all) then I shouldn't be getting any error. But it is giving me any error that startDate
is required.
Any assistance will be highly appreciated.