Propaganistas / Laravel-Phone

Phone number functionality for Laravel
https://laravel-phone.herokuapp.com/
MIT License
2.7k stars 214 forks source link

Local phone numbers pass, internationally formatted numbers don't #85

Closed Ziadjb closed 6 years ago

Ziadjb commented 6 years ago

When we try to validate a 9 numbers phone number, eg. 056475896 OR 56475896 it passes. But, when I try it with the country telephone code eg +3356475896, or +3456475896, or +156475896, or +21256475896, it does not pass. Why?

056475896 or 56475896 should be an invalid phone number format


phone:FR,ES,MA,US,BE accept 9 numbers format without telephone code

Propaganistas commented 6 years ago

056475896 is a valid Belgian phone number. Since you configured that the phone number can belong to either one of those six countries (including Belgium), the validator passes. As soon as a phone number is entered in international format (+XX) it inherently belongs to that country and will only be validated to see if it is valid for that country.