packagist propaganistas/laravel-phone 3.0.0

latest releases: dev-master, 5.3.2, 5.3.1...
7 years ago

Overview

  • Rewritten validator class.
  • Exposed an expressive Rule class.
  • Added an extensive PhoneNumber class for more granular formatting and phone number information.
  • Addressed #55 : auto-detection when formatting.

Breaking changes

  • The Service Provider is renamed. Please change to Propaganistas\LaravelPhone\PhoneServiceProvider.
  • The Facade to libphonenumber is removed in favor of the new PhoneNumber utility class. If you really need the Facade, just create it yourself.
  • The validator will now only throw an exception when invalid parameters are encountered. All other erroneous cases such as invalid countries will validate to false.
  • Three additional exceptions may be thrown when formatting a phone number:
    • Propaganistas\LaravelPhone\Exceptions\NumberParseException: when the number could not be parsed by libphonenumber (e.g. invalid country, no country, ...).
    • Propaganistas\LaravelPhone\Exceptions\NumberFormatException: when an invalid phone format is provided.
    • Propaganistas\LaravelPhone\Exceptions\CountryCodeException: when an invalid calling-from country is provided (formatForCountry() and formatForMobileDialingInCountry()).

Don't miss a new laravel-phone release

NewReleases is sending notifications on new releases.