- 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 and requires no additional setup beyond dependency injection or facade binding.
- Does this package work with Laravel 10+ and PHP 8.2?
- Yes, the package supports Laravel 9+ and PHP 8.1+. Check the [GitHub releases](https://github.com/moneyphp/iso-currencies/releases) for version-specific compatibility notes, but it’s designed to be backward-compatible with modern Laravel stacks.
- Can I use this package without **moneyphp/money**?
- Technically yes, but it’s not officially supported. The package is optimized for **moneyphp/money** and may require custom abstraction (e.g., a facade or service layer) to decouple MoneyPHP-specific logic for standalone use.
- How do I update currency data to the latest ISO 4217 standards?
- Run `composer fetch-update` in your project directory. This command pulls the latest currency definitions from the official ISO Maintenance Agency. Schedule this in CI/CD pipelines for automated updates.
- Does this package handle historical currencies like BGN (pre-2026) or legacy codes?
- Yes, the package automatically flags historical currencies (e.g., BGN → EUR transition) to ensure compliance. This is critical for Laravel apps handling legacy transactions or regulatory reporting.
- Will this package work with **laravel-money** or other Laravel financial packages?
- Absolutely. The package is designed to integrate with **laravel-money** and other Laravel financial libraries. Bind the `CurrencyRepository` as a singleton in `AppServiceProvider` for seamless dependency injection.
- Are there performance concerns with using this package in production?
- No, the package is lightweight and static—it adds zero runtime overhead. Currency data is loaded once during initialization, making it ideal for high-traffic Laravel APIs or payment gateways.
- How do I test this package in a Laravel application?
- Mock the `CurrencyRepository` in your tests using Laravel’s service container. For example, bind a test implementation in `phpunit.xml` or use `partialMock` to override currency data without affecting production.
- What alternatives exist for ISO 4217 currency data in Laravel?
- Alternatives include **league/money** (with its own currency data) or third-party APIs like **Open Exchange Rates**. However, this package is unique in its direct sourcing from the ISO Maintenance Agency and Composer-friendly updates.
- How do I handle non-ISO currencies (e.g., cryptocurrencies) alongside ISO 4217?
- This package is ISO 4217-only. For non-ISO currencies, supplement it with a separate data source (e.g., a custom database table or API) and create a unified service layer to normalize currency validation logic.