承接 macmotp/currencies 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

macmotp/currencies

Composer 安装命令:

composer require macmotp/currencies

包简介

Curated list of currencies in PHP

README 文档

README

Latest Version on Packagist Total Downloads

Library to Handle Currencies in PHP, simple and light

Useful for any ecommerce, fintech, or any app that requires 💰.

Requirements

  • PHP >= 8.2

Installation

Install the package via composer:

composer require macmotp/currencies

This package is a main dependency for other 2 packages

Usage

Create Currency objects

use Macmotp\Currency;
use Macmotp\Currencies\Support\CurrencyCode;
use Macmotp\Currencies\Support\CurrencyName;

// All Currencies adopt ISO 4217 standard
$currencyCode = CurrencyCode::USD;

// Create the object
$currency = new Currency($currencyCode);

// You can also input the code as string:
$currency = new Currency('USD');

// Alternative methods:
$currency = Currency::make($currencyCode);
$currency = Currency::fromCode($currencyCode);

echo $currency->toArray();

// [
//    'name' => 'United States Dollar',
//    'code' => 'USD',
//    'symbol' => '$',
//    'flag' => 'us',
//    'format' => [
//       'show_code' => false,
//       'show_symbol' => true,
//       'show_space' => false,
//       'show_symbol_or_code_on_left' => true,
//       'show_decimals' => true,
//       'decimal_separator' => '.',
//       'thousands_separator' => ',',
//       'number_of_decimals' => 2,
//       'subunit_level' => 2,
//    ],
// ]

List of basic methods

  • getName(): it returns the name;
  • getCode(): it returns the code;
  • getSymbol(): it returns the symbol;
  • getFlag(): it returns the flag (country code);
  • getFormat(): it returns the currency format;
  • toArray(): it converts the object into array;

List of Currencies in the package

use Macmotp\Currency;

$list = Currency::all();
// This will return a Illuminate\Support\Collection

These are the implemented currencies:

  • AED: United Arab Emirates Dirham
  • AFN: Afghan Afghani
  • ALL: Albanian Lek
  • AMD: Armenian Dram
  • ANG: Netherlands Antillean Guilder
  • AOA: Angolan Kwanza
  • ARS: Argentine Peso
  • AUD: Australian Dollar
  • AWG: Aruban Florin
  • AZN: Azerbaijani Manat
  • BAM: Bosnia and Herzegovina Convertible Mark
  • BBD: Barbados Dollar
  • BDT: Bangladeshi Taka
  • BGN: Bulgarian Lev
  • BHD: Bahraini Dinar
  • BIF: Burundian Franc
  • BMD: Bermudian Dollar
  • BND: Brunei Dollar
  • BOB: Bolivian Boliviano
  • BRL: Brazilian Real
  • BSD: Bahamian Dollar
  • BTC: Bitcoin
  • BTN: Bhutanese Ngultrum
  • BWP: Botswana Pula
  • BYN: Belarusian Ruble
  • BZD: Belize Dollar
  • CAD: Canadian Dollar
  • CDF: Congolese Franc
  • CHF: Swiss Franc
  • CLP: Chilean Peso
  • CNY: Chinese Yuan - Renminbi
  • COP: Colombian Peso
  • CRC: Costa Rican Colón
  • CUP: Cuban Peso
  • CVE: Cape Verdean Escudo
  • CZK: Czech Koruna
  • DJF: Djiboutian Franc
  • DKK: Danish Krone
  • DOP: Dominican Peso
  • DZD: Algerian Dinar
  • EGP: Egyptian Pound
  • ERN: Eritrean Nakfa
  • ETB: Ethiopian Birr
  • EUR: Euro
  • FJD: Fijian Dollar
  • FKP: Falkland Islands Pound
  • GBP: British Pound
  • GEL: Georgian Lari
  • GHS: Ghanaian Cedi
  • GIP: Gibraltar Pound
  • GMD: Gambian Dalasi
  • GNF: Guinean Franc
  • GTQ: Guatemalan Quetzal
  • GYD: Guyanese Dollar
  • HKD: Hong Kong Dollar
  • HNL: Honduran Lempira
  • HTG: Haitian Gourde
  • HUF: Hungarian Forint
  • IDR: Indonesian Rupiah
  • ILS: Israeli New Shekel
  • INR: Indian Rupee
  • IQD: Iraqi Dinar
  • IRR: Iranian Rial
  • ISK: Icelandic Króna
  • JMD: Jamaican Dollar
  • JOD: Jordanian Dinar
  • JPY: Japanese Yen
  • KES: Kenyan Shilling
  • KGS: Kyrgyz Som
  • KHR: Cambodian Riel
  • KMF: Comorian Franc
  • KPW: North Korean Won
  • KRW: South Korean Won
  • KWD: Kuwaiti Dinar
  • KYD: Cayman Islands Dollar
  • KZT: Kazakhstani Tenge
  • LAK: Lao Kip
  • LBP: Lebanese Pound
  • LKR: Sri Lankan Rupee
  • LRD: Liberian Dollar
  • LSL: Lesotho Loti
  • LYD: Libyan Dinar
  • MAD: Moroccan Dirham
  • MDL: Moldovan Leu
  • MGA: Malagasy Ariary
  • MKD: Macedonian Denar
  • MMK: Burmese Kyat
  • MNT: Mongolian Tögrög
  • MOP: Macanese Pataca
  • MRU: Mauritanian Ouguiya
  • MUR: Mauritian Rupee
  • MVR: Maldivian Rufiyaa
  • MWK: Malawian Kwacha
  • MXN: Mexican Peso
  • MYR: Malaysian Ringgit
  • MZN: Mozambican Metical
  • NAD: Namibian Dollar
  • NGN: Nigerian Naira
  • NIO: Nicaraguan Córdoba
  • NOK: Norwegian Krone
  • NPR: Nepalese Rupee
  • NZD: New Zealand Dollar
  • OMR: Omani Rial
  • PAB: Panamanian Balboa
  • PEN: Peruvian Sol
  • PGK: Papua New Guinean Kina
  • PHP: Philippine Peso
  • PKR: Pakistani Rupee
  • PLN: Polish Złoty
  • PYG: Paraguayan Guaraní
  • QAR: Qatari Riyal
  • RON: Romanian Leu
  • RSD: Serbian Dinar
  • RUB: Russian Ruble
  • RWF: Rwandan Franc
  • SAR: Saudi Riyal
  • SBD: Solomon Islands Dollar
  • SCR: Seychellois Rupee
  • SDG: Sudanese Pound
  • SEK: Swedish Krona
  • SGD: Singapore Dollar
  • SHP: Saint Helena Pound
  • SLE: Sierra Leonean Leone
  • SOS: Somali Shilling
  • SRD: Surinamese Dollar
  • SSP: South Sudanese Pound
  • STN: São Tomé and Príncipe Dobra
  • SYP: Syrian Pound
  • SZL: Swazi Lilangeni
  • THB: Thai Baht
  • TJS: Tajikistani Somoni
  • TMT: Turkmenistani Manat
  • TND: Tunisian Dinar
  • TOP: Tongan Paʻanga
  • TRY: Turkish Lira
  • TTD: Trinidad and Tobago Dollar
  • TWD: New Taiwan Dollar
  • TZS: Tanzanian Shilling
  • UAH: Ukrainian Hryvnia
  • UGX: Ugandan Shilling
  • USD: United States Dollar
  • UYU: Uruguayan Peso
  • UZS: Uzbekistani Sum
  • VES: Venezuelan Sovereign Bolívar
  • VND: Vietnamese Đồng
  • VUV: Vanuatu Vatu
  • WST: Samoan Tālā
  • XAF: Central African CFA Franc
  • XCD: Eastern Caribbean Dollar
  • XOF: West African CFA Franc
  • XPF: CFP Franc
  • YER: Yemeni Rial
  • ZAR: South African Rand
  • ZMW: Zambian Kwacha
  • ZWG: Zimbabwe Gold

If you want to add another currency, please open an issue.

Testing

composer test

Changelog

Please see changelog for more information on what has changed recently.

Contributing

Please see contributing for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

macmotp/currencies 适用场景与选型建议

macmotp/currencies 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.2k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 09 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「currencies」 「macmotp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 macmotp/currencies 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-29