aquinoaldair / phone-code
Códigos de teléfonos o marcación por país en laravel
1.4
2020-04-23 19:46 UTC
Requires
- php: ^7.1.3
- illuminate/support: ^5.8|^6.0|^7.0
Requires (Dev)
- orchestra/testbench: ^3.8|^4.0
- phpunit/phpunit: 7.5|^8.0
This package is auto-updated.
Last update: 2024-10-24 05:54:03 UTC
README
Laravel 5.8 or higher, 6.x, 7.x
Installation
You can install the package via composer:
composer require aquinoaldair/phone-code
Usage
Properties:
nombre, name, phone_code, iso2, iso3
use Aquinoaldair\PhoneCode\PhoneCode; //PRINCIPAL FUNCTIONS $phonecode = new PhoneCode(); $phonecode->make("2281694545")->fromName('Mexico'); // return "522281694545" $phonecode->makeFull("2281694545")->fromName('Mexico'); // return "+522281694545" $phonecode->make("2281694545")->fromIso2('MX'); // return "522281694545" $phonecode->makeFull("2281694545")->fromIso2('MX'); // return "+522281694545" $phonecode->make("2281694545")->fromIso3('MEX'); // return "522281694545" $phonecode->makeFull("2281694545")->fromIso3('mex'); // return "+522281694545" $phonecode->getAll(); // return all data as collection //STATICS FUNCTIONS PhoneCode::isCodeOf(51); // "Peru" PhoneCode::codeOf("Peru"); // "51" $items = PhoneCode::get(); // return a collection // Working with collections $item = $items->first(); $item->phone_code; // "93 $item->nombre; // "Afganistán" $item->name; // "Afghanistan" $item->iso2; // "AF" $item->iso3; // "AFG" $items->firstWhere('name', "Peru"); /* { "nombre": "Perú" "name": "Peru" "nom": "Pérou" "iso2": "PE" "iso3": "PER" "phone_code": "51" } */ - You can implement any functionality of the laravel collections. - See https://laravel.com/docs/7.x/collections
Configuration
php artisan vendor:publish --tag=config
This will publish all the configuration options to: config/phone-code.php. You can add new values.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email aquinoaldair@hotmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.