Phone Input - option for simple text input (#207)
Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -13,8 +13,12 @@ class ValidPhoneInputRule implements Rule
|
||||
return false;
|
||||
}
|
||||
|
||||
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
|
||||
return $phoneUtil->isValidNumber($phoneUtil->parse($value));
|
||||
try {
|
||||
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
|
||||
return $phoneUtil->isValidNumber($phoneUtil->parse($value));
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function message()
|
||||
|
||||
Reference in New Issue
Block a user