I have a form that form has two dropdown. If I submit form I need to validate and show at-least one dropdown required. I have added some functionality but not working.
create.blade.php
<select class="form-control" id="user" name="user">
<option value="0"> select user </option>
<option value="1"> jane </option>
<option value="2"> peter </option>
</select>
<select class="form-control" id="email" name="email">
<option value="0"> select email</option>
<option value="1"> jane@gmail.com </option>
<option value="2"> peter@gmail.com </option>
</select>
CreateRequest.php
public function rules()
{
$rules = [
'user' => 'required_without_all:email|not_in:0',
'email' => 'required_without_all:user|not_in:0',
];
return $rules;
}