Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel required only one of multiple fields not both

prohibited
The field under validation must be empty or not present.

prohibited_if:anotherfield,value,...
The field under validation must be empty or not present if the anotherfield field is equal to any value.

prohibited_unless:anotherfield,value,...
The field under validation must be empty or not present unless the anotherfield field is equal to any value.

prohibits:anotherfield,...
If the field under validation is present, no fields in anotherfield can be present, even if empty.
Comment

How to make one of two fields required in php laravel

$rules = array(
    'Email' => 'required_without:QQ',
    'QQ' => 'required_without:Email',
);
Comment

PREVIOUS NEXT
Code Example
Php :: create user with tinker php laravel 
Php :: php curl post 
Php :: Add 5 days to the current date in PHP 
Php :: get last id in laravel 
Php :: laravel orderby with relation 
Php :: get category post in wordpress 
Php :: print url in view yii2 
Php :: php mysql if not exists insert 
Php :: php print character x times 
Php :: php number positive 
Php :: wordpress remove user roles 
Php :: wpdb-prepare 
Php :: laravel check if table has column 
Php :: PHP Max Input Vars 
Php :: is home page if wordpress 
Php :: call to a member function connection() on null test laravel 
Php :: laravel collection random 
Php :: php echo 
Php :: laravel drop column 
Php :: laravel sort collection 
Php :: update onlu one column laravel 
Php :: message mkdir() invalid path filename drivers/session_files_driver.php 
Php :: acf php fields 
Php :: php convert mb to bytes 
Php :: Format and show date PHP 
Php :: php reduce 
Php :: php var exists 
Php :: php trim string if longer than 
Php :: php convert to lowercase 
Php :: return view controller laravel 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =