From 86d55cc6429c94ae235850c210f953cd0b806a84 Mon Sep 17 00:00:00 2001 From: Joseph Paul Date: Mon, 4 May 2015 14:44:44 +0200 Subject: [PATCH] make validator only pass if the number is valid for one of the specified countries --- src/Propaganistas/LaravelPhone/Validator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propaganistas/LaravelPhone/Validator.php b/src/Propaganistas/LaravelPhone/Validator.php index 66e6735..b5207de 100755 --- a/src/Propaganistas/LaravelPhone/Validator.php +++ b/src/Propaganistas/LaravelPhone/Validator.php @@ -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; } }