dubbeltje
7 months ago

Required_if in array Structure

Posted 7 months ago by dubbeltje
persons.*.birthdate=> [
    required_if:persons.*.birthdate_private,false
];

Here I have a validation rule whch says that a birthdate needs to be entered only if the birthdate is not private.

So now I have a form with 2 persons. For one the brithdate is not private and I entered the birth date. For the second one the birthdate is private and didn't enter the birthdate.

Now this validation rule still fails and gives a 422 error

How Can I properly create this rule?

Please sign in or create an account to participate in this conversation.