- How do I install **moneyphp/iso-currencies** in a Laravel project?
- Run `composer require moneyphp/iso-currencies` in your project directory. The package integrates seamlessly with Laravel’s Composer workflow, requiring no additional setup beyond dependency injection.
- Does this package support Laravel 10+ and PHP 8.1+?
- Yes, the package is fully compatible with Laravel 10.x and PHP 8.1+. It adheres to modern PHP standards and has no known breaking changes for these versions.
- How do I update the ISO 4217 currency data?
- Use the Composer script `composer fetch-update` to pull the latest official ISO 4217 data. This updates the dataset without manual intervention, ensuring compliance with the latest standards.
- Can I use this package for non-financial localization (e.g., country flags)?
- No, this package is **exclusively designed for financial use** with **moneyphp/money**. It provides only ISO 4217 currency metadata—no country flags, historical data, or cryptocurrencies.
- How does this integrate with Laravel’s service container?
- Bind the `CurrencyRepository` to Laravel’s container in `AppServiceProvider::boot()` using `$this->app->bind(CurrencyRepository::class, function () { return new CurrencyRepository(); });`. This enables dependency injection across your app.
- Will this work with **moneyphp/currency** or other MoneyPHP packages?
- Yes, this package is a **direct companion** to **moneyphp/money** and **moneyphp/currency**. It ensures your financial logic uses the latest ISO 4217 standards, reducing validation errors in transactions.
- What if my app needs cryptocurrencies or custom currencies?
- This package **only supports ISO 4217 currencies**. For cryptocurrencies or dynamic data, consider extending the `CurrencyRepository` or using a third-party API like CoinGecko.
- How often should I run `composer fetch-update` in production?
- Run updates **monthly or quarterly** in CI/CD pipelines to align with ISO 4217 amendments. Avoid frequent updates in production to minimize deployment risks unless critical compliance changes occur.
- Does this package include decimal precision rules (e.g., JPY = 0 decimals)?
- Yes, the dataset includes **decimal precision rules** for each currency (e.g., JPY = 0, USD = 2). This prevents financial errors in payment processing or invoicing systems.
- Are there alternatives if I need more than ISO 4217 currencies?
- For broader currency support (e.g., cryptocurrencies, historical data), consider **symfony/money** or **league/currency**, though neither provides ISO 4217’s official compliance. This package remains the gold standard for ISO 4217.