Home >Backend Development >PHP Tutorial >How does laravel verify that one of the two fields is required?

How does laravel verify that one of the two fields is required?

WBOY
WBOYOriginal
2016-12-01 00:57:052099browse

For example: if email and phone are filled in, the verification will be passed. How to write the verification rules?

Reply content:

For example: if email and phone are filled in, the verification will be passed. How to write the verification rules?

<code>'email' => 'required_without:phone',
'phone' => 'required_without:email',</code>

For details, please see:
https://laravel.com/docs/5.3/...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn