My question is about Laravel validation rules.
I have two inputs a and b. a is a select input with three possible values: x, y and z. I want to write this rule:
bmust have a value only ifavalues isx. Andbmust be empty otherwise.
Is there a way to write such a rule? I tried required_with, required_without but it seems it can not cover my case.
In other words, if the previous explanation was not clear enough:
- If
a==x,bmust have a value. - If
a!=x,bmust be empty.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire