{"repo":"Propaganistas/Laravel-Phone","free":true,"listed":false,"github":"https://github.com/Propaganistas/Laravel-Phone","clone":"git clone https://github.com/Propaganistas/Laravel-Phone.git","description":"Phone number functionality for Laravel","language":"PHP","stars":3024,"topics":["laravel","libphonenumber","validation","phone"],"license":"MIT","category":"databases-storage","readme_excerpt":"Laravel Phone Adds phone number functionality to Laravel based on the PHP port of libphonenumber by Google. Table of Contents - Demo - Installation - Validation - Attribute casting - Utility class - Formatting - Number information - Equality comparison - Database considerations Demo Check out the behavior of this package in the demo. Installation Run the following command to install the latest applicable version of the package: The Service Provider gets discovered automatically by Laravel. In your languages directory, add an extra translation in every validation.php language file: Validation Use the phone keyword in your validation rules array or use the Propaganistas\\LaravelPhone\\Rules\\Phone rule class to define the rule in an expressive way. To put constraints on the allowed originating countries, you can explicitly specify the allowed country codes. Or to make things more dynamic, you can also match against another data field holding a country code. For example, to require a phone number to match the provided country of residence. Make sure the country field has the same name as the phone field but with country appended for automatic discovery, or provide your custom country field name as a parameter to the validator: Note: country codes should be ISO 3166-1 alpha-2 compliant . To support any valid internationally formatted phone number next to the whitelisted countries, use the INTERNATIONAL parameter. This can be useful when you're expecting locally formatted numbers fro","default_branch":null,"files":null,"tree":[],"storefront":"/r/Propaganistas","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Propaganistas/Laravel-Phone/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}