moneyphp/iso-currencies
Provides an up-to-date ISO 4217 currency list sourced from the official ISO Maintenance Agency resources. Built primarily to support moneyphp/money, with composer commands to install and fetch updates.
Laravel/PHP Stack Alignment:
CurrencyRepository interface integrates natively with Laravel’s dependency injection (DI) system, requiring minimal configuration (e.g., binding the repository in AppServiceProvider::boot()). This aligns with Laravel’s architectural patterns, reducing boilerplate and improving maintainability.composer require) and updates (composer fetch-update), eliminating custom scripts or workflows.config/currencies.php), though this is primarily relevant for Symfony-heavy applications.Financial Use Case Fit:
moneyphp/money, enabling tight integration with Laravel’s financial stack (e.g., moneyphp/currency). Reduces friction for applications already using or planning to adopt the moneyphp ecosystem.Performance and Scalability:
Architectural Trade-offs:
moneyphp/money, limiting flexibility for non-monetary use cases (e.g., localization without financial operations). Custom extensions may be needed, increasing technical debt.composer fetch-update, introducing operational friction (e.g., CI/CD pipeline changes) and potential compliance gaps between ISO amendments and package releases (typically 6–12 months).Laravel-Specific Considerations:
CurrencyRepository to Laravel’s container (e.g., in AppServiceProvider). Example:
$this->app->bind(CurrencyRepository::class, function ($app) {
return new CurrencyRepository();
});
config/currencies.php) for customizing default behavior, though the package itself is minimalist.composer fetch-update command can be wrapped in a custom Artisan command for automated updates via CI/CD (e.g., GitHub Actions).Migration Path:
CurrencyRepository.AppServiceProvider and update all currency-related logic to use the package’s methods (e.g., getCurrency(), isValidCurrency()).composer fetch-update in CI/CD to ensure currency data stays current (e.g., weekly or monthly).Compatibility Risks:
current.json), which may break custom implementations. Audit existing code for direct file access.Currency Use Cases:
Integration Scope:
moneyphp/money? If not, will the package’s coupling introduce unnecessary complexity?Operational Workflow:
composer fetch-update in CI/CD, or manually trigger updates?Long-Term Maintenance:
Alternatives:
league/currency, money/money) or custom solutions? What trade-offs exist?Performance:
Compliance:
Laravel Ecosystem:
CurrencyRepository integrates seamlessly with Laravel’s DI system, requiring only a single binding in AppServiceProvider. Example:
// app/Providers/AppServiceProvider.php
public function boot()
{
$this->app->bind(
\Money\Currency\CurrencyRepository::class,
\MoneyPhp\IsoCurrencies\CurrencyRepository::class
);
}
config/currencies.php for customizing default behavior (e.g., default currency, excluded currencies).Symfony/Lumen Compatibility:
PHP Version Support:
Database/ORM:
$repository = new CurrencyRepository();
return Cache::remember('currencies', now()->addYear(), fn() => $repository);
Assessment Phase:
Pilot Integration:
How can I help you explore Laravel packages today?