Level 10
You can use
nom => "required_without:prenom,email",
prenom => "required_without:nom,email",
email => "required_without:nom,prenom",
Or required_without_all, depending on your situation. Documentation here
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
To validate a form, I must have either nom or prenom or email.
If I set each field to required in my ContactRequest file, each one will be required. But I need only one required among the three.
How is it possible to set this validation rule ?
Thanks.
Vincent
You can use
nom => "required_without:prenom,email",
prenom => "required_without:nom,email",
email => "required_without:nom,prenom",
Or required_without_all, depending on your situation. Documentation here
Please or to participate in this conversation.