irando/country-codes
Composer 安装命令:
composer require irando/country-codes
包简介
The most complete country code list fpackage for laravel
README 文档
README
This is a Composer plugin that provides an automated version of Country Codes database.
This database is include: country iso codes, country names, country names with phone codes, phone codes as well as admin page to manage your list of data.
What you can do?
- Get users country names
- Get users phone numbers
- Send OTP codes
- Send message on messangers
Usage of this package are vary, those were just small examples of what you can do.
Also my main reason to build this package was to send WhatsApp message (specifically OTP codes).
Table Of Contents
Requirements
| Source | Version |
|---|---|
| Composer | ^2.0 |
| PHP | ^7.4/^8.0 /^8.2 |
Installation
The only thing you need to do to make this work is adding this package as a dependency to your project:
composer require irando/country-codes
Usage
- Add following line in your
config/app.phpfile
'providers' => [ // ... Irando\CountryCodes\CountryCodesServiceProvider::class, ];
- Run either of commands below to publish package files
php artisan vendor:publish
And select id referred to:
Irando\CountryCodes\CountryCodesServiceProvider
OR
php artisan vendor:publish --tag=country-codes
- Run
php artisan migrateto add countries table into your database - Run
php artisan db:seed --class=CountryCodesTableSeederto seed countries data into countries table.
Note: In case of error after this command run
composer dumpautoloadand try again to seed database
Now visit
your_url.tld/country-codesand you are set.
Customization
If you need (probably you do!) to customize the look, routing, functionality etc. of this package, at stage 2 of installation we deployed CountryCodes.php which is your table model, as well as view files at resources/views/vendor/irando/country-codes you can edit those files and create your own.
Contributing
All feedback / bug reports / pull requests are welcome.
You can support me for more open source projects by sponsoring this package
License
This code is released under the MIT license.
For the full copyright and license information, please view the LICENSE file distributed with this source code.
Developed by Robert Nicjoo at CV. IRANDO
irando/country-codes 适用场景与选型建议
irando/country-codes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 212 次下载、GitHub Stars 达 20, 最近一次更新时间为 2022 年 08 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「country」 「iso」 「country codes」 「laravel8」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 irando/country-codes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 irando/country-codes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 irando/country-codes 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Sun Country is the package that helps you to get the country name & dialing code by the country ISO 3166-1 Alpha-2 code.
List of all countries with names and ISO 3166-1 codes in all languages and data formats for Laravel
Country select field type.
Country Flag Emoji for PHP
Check for holidays - localeaware
Metamel Addresses is a polymorphic Laravel package, for address book management. You can add addresses to any eloquent model with ease.
统计信息
- 总下载量: 212
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-05
