Issue
I know for email address, which is given below. so, suggest me for mobile number.
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->isUnique(['email']));
return $rules;
}
Solution
You can just replicate what you've got for checking the email address is unique for the relevant mobile field. For example, if your field was phone:-
public function buildRules(RulesChecker $rules)
{
$rules->add($rules->isUnique(['email']));
$rules->add($rules->isUnique(['phone']));
return $rules;
}
You can read more on validating unique fields in the official docs.
Answered By - drmonkeyninja
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.