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 required_if
, but I believe that it can only declare one field and several values, but not more than one field.
The code looks like this:
'signature-one'=>'required_if:signature-two,null|required_if:signature-three,null|integer',
'signature-two'=>'nullable|sometimes|integer',
'signature-three'=>'nullable|sometimes|integer',
In the way the signature-one field is, it will be mandatory even though one of the other two is null
, and I wanted it to be mandatory only if both were null
. Can anyone help me?