定制 medo19/naqd 二次开发

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

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

medo19/naqd

最新稳定版本:v1.0.0

Composer 安装命令:

composer require medo19/naqd

包简介

Naqd is a lightweight package that provides ISO 4217-compliant currency data along with corresponding Unicode symbols and SVG icons.

README 文档

README

Naqd is a lightweight Laravel package that provides ISO 4217-compliant Naqd data, including Naqd codes, names, symbols, and SVG icons for easy display and localization.

📦 Installation

  1. Add the package to your Laravel project's composer.json (if locally developed):
composer require medo19/naqd

⚙️ Service Provider & Facade (Auto-discovered)

For Laravel 5.5+, this package uses auto-discovery.

If you need to register manually:

// config/app.php
'providers' => [
    Medo19\Naqd\NaqdServiceProvider::class,
],

'aliases' => [
    'Naqd' => Medo19\Naqd\Facades\Naqd::class,
]

🧰 Usage

Get all currencies:

$currencies = Naqd::all();

Get a specific Naqd:

$usd = Naqd::get('usd');

// Result:
[
    "code" => "USD",
    "name" => "United States Dollar",
    "symbol" => "$",
    "unicode" => "U+0024",
    "numeric" => "840",
    "decimal_digits" => 2,
    "svg" => "usd.svg"
]

Display an SVG (inline):

In Blade:

{!! Naqd::getSvg('usd') !!}

Outputs the full <svg>...</svg> inline.

🖼️ Publishing Assets

You can publish the Naqd JSON file or SVG icons if needed:

php artisan vendor:publish --tag=currencies-config

Or add your own publishing tags in NaqdServiceProvider.

🗂 Directory Structure

packages/
└── medo19/
    └── naqd/
        ├── src/
        │   ├── data/
        │   │   ├── currencies.json
        │   │   └── svg/
        │   │       ├── usd.svg
        │   │       ├── eur.svg
        │   │       └── ...
        │   ├── Naqd.php
        │   ├── NaqdServiceProvider.php
        │   └── Facades/
        │       └── Naqd.php
        └── composer.json

📜 License

MIT License — Free to use and modify.

🤝 Contributions

Feel free to submit PRs or suggestions.

📧 Maintainer

Muhammad Abdulrazek GitHub: @medo19

---

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-07-21