php – Required_if with more than one field in Laravel 5.3


I have the following situation: I want a field to be mandatory only if the other two are null , if one of the other two is not null this field is no longer mandatory.

I thought about using the required_if , however I believe it can only declare one field and several values, but not more than one field.

The code looks like this:


the way it is, the signature-one field is going to be mandatory even if one of the other two is null , and I wanted it to be mandatory only if both were null . Can someone help me?


The test for this type is with required_without_all , where translation says:

The field being validated must be present and not empty only when all other specified fields are not present.




Scroll to Top