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
- 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
其他信息
- 授权协议: Unknown
- 更新时间: 2025-07-21