aquinoaldair/phone-code
Composer 安装命令:
composer require aquinoaldair/phone-code
包简介
Códigos de teléfonos o marcación por país en laravel
README 文档
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.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-22