Skip to content

Commit

Permalink
Merge pull request #10 from jsphpl/master
Browse files Browse the repository at this point in the history
Validate phone number for country as well
  • Loading branch information
Propaganistas committed May 4, 2015
2 parents 19ad884 + 86d55cc commit a76251e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Propaganistas/LaravelPhone/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function phone($attribute, $value, $parameters, $validator)
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
try {
$phoneProto = $phoneUtil->parse($value, $country);
if ($phoneUtil->isValidNumber($phoneProto)) {
if ($phoneUtil->isValidNumberForRegion($phoneProto, $country)) {
return TRUE;
}
}
Expand Down

0 comments on commit a76251e

Please sign in to comment.