定制 ayoub-amzil/offline-globe 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ayoub-amzil/offline-globe

Composer 安装命令:

composer require ayoub-amzil/offline-globe

包简介

Offline country data for PHP. Over 200 countries, capitals, flags, languages, currencies. No internet needed.

README 文档

README

Offline country data for PHP Laravel framework. Over 200 countries, capitals, flags, languages, currencies. No internet needed. This packages uses the 7 model continent, and this is a Reference for all the countries included.

Installation

  cd my-laravel-project
  composer require ayoub-amzil/offline-globe

Usage/Examples

Import class

use offline\Globe; 

Create an instance

$globe = new Globe();

Functions available

Return an array type value of all countries available

$globe->Countries()

Return an array type value of African countries

$globe->African()

Return an array type value of Asian countries

$globe->Asian()

Return an array type value of Australian countries

$globe->Australia()

Return an array type value of European countries

$globe->Europe()

Return an array type value of North America countries

$globe->NorthAmerica()

Return an array type value of South America countries

$globe->SouthAmerica()

Return the country code of the given country. The function accept one argument of type string.

$globe->Code('Morocco') // MA (return type: string)

Return the capital of the given country. The function accept one argument of type string.

$globe->Capital('japan') // Tokyo (return type: string)

Return the Languages spoken in the given country. The function accept one argument of type string.

$globe->Language('jamaica') // ['english', 'jamaican_patois'] (return type: array)

Return the currency used in the given country. The function accept one or two arguments

// It can take only the country (mandatory)
$globe->Currency('Canada') // ['name' => 'Canadian Dollar', 'code' => 'CAD'] (return type: array)

// Or the country plus one type of information
// name (option)
$globe->Currency('canada','name') // Canadian Dollar (return type: string)
// code (option)
$globe->Currency('canada','code') // CAD (return type: string)

Return the flag of the given country. The function accept three arguments. Country, type of the flag, and a directory name where the flags are saved.

// country (mandatory)
return view('welcome',
            ['flag'=>$globe->flag('united states')]
        ); //  (return type: string)

// In your template
<img src="{{$flag}}" alt="image">
// type (option) [default=svg]
return view('welcome',
            ['flag'=>$globe->flag('united states','png')]
        ); //  (return type: string)

// In your template
<img src="{{$flag}}" alt="image">
// directory name (option) [default=flags]
// PS:  if you want to change your directory name, you have to set the type before
return view('welcome',
            ['flag'=>$globe->flag('united states','png','images')]
        ); //  (return type: string)

// In your template
<img src="{{$flag}}" alt="image">

Authors

@ayoub-amzil

License

MIT

Contributing

Contributions are always welcome!

Acknowledgements

ayoub-amzil/offline-globe 适用场景与选型建议

ayoub-amzil/offline-globe 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 55 次下载、GitHub Stars 达 2, 最近一次更新时间为 2023 年 12 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ayoub-amzil/offline-globe 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ayoub-amzil/offline-globe 我们能提供哪些服务?
定制开发 / 二次开发

基于 ayoub-amzil/offline-globe 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 55
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-31