medo19 / naqd
Naqd is a lightweight package that provides ISO 4217-compliant currency data along with corresponding Unicode symbols and SVG icons.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/medo19/naqd
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
---