Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phone:INTERNATIONAL rule stopped working #250

Closed
julienarcin opened this issue Apr 23, 2024 · 2 comments
Closed

phone:INTERNATIONAL rule stopped working #250

julienarcin opened this issue Apr 23, 2024 · 2 comments

Comments

@julienarcin
Copy link

julienarcin commented Apr 23, 2024

After upgrading to the last version, the validation rule stopped working:

'phone' => ['required', 'phone:INTERNATIONAL'],

I'm running a test and trying to create a phone with number +12345678901234, it should return a validation error.

But I get an exception:

TypeError: libphonenumber\PhoneNumberUtil::isValidNumberForRegion(): Argument #2 ($regionCode) must be of type string, null given, called in /Users/julienarcin/Code/template-application/vendor/propaganistas/laravel-phone/src/PhoneNumber.php on line 170 and defined in /Users/julienarcin/Code/template-application/vendor/giggsey/libphonenumber-for-php-lite/src/PhoneNumberUtil.php:2958
Stack trace:
#0 /Users/julienarcin/Code/template-application/vendor/propaganistas/laravel-phone/src/PhoneNumber.php(170): libphonenumber\PhoneNumberUtil->isValidNumberForRegion(Object(libphonenumber\PhoneNumber), NULL)
#1 /Users/julienarcin/Code/template-application/vendor/propaganistas/laravel-phone/src/Rules/Phone.php(64): Propaganistas\LaravelPhone\PhoneNumber->isValid()
#2 /Users/julienarcin/Code/template-application/vendor/propaganistas/laravel-phone/src/PhoneServiceProvider.php(34): Propaganistas\LaravelPhone\Rules\Phone->passes('phone', '+12345678901234...')
...
@allmanaj
Copy link

I can confirm that I'm having this same problem!

@Propaganistas
Copy link
Owner

Thanks for reporting; it's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants