I'm trying to validate three input fields.
If the fields are null then the three fields are not mandatory, but If at least one of them is not empty (null) then all three should be mandatory. But It's doesn't working. If I leave all three fields blank It shows that the three fields are mandatory. It shoud allow the form to be submitted.
public function rules()
{
return [
'a' => 'required_if:b,!=,null|required_if:c,!=,null',
'b' => 'required_if:a,!=,null|required_if:c,!=,null',
'c' => 'required_if:a,!=,null|required_if:b,!=,null',
];
}