In Laravel, how do I do validation to check if checkbox is checked and text input is not empty.
For example:
If checkbox is ticked
<input type="checkbox" name="has_login" checked="checked" value="1">
and pin is not empty then validation should be passed.
<input type="text" name="pin" value="">
In Request file file:
public function rules()
{
return [
'has_login' => ??,
];
}
"pin" => "required""pin" => "required"