tourze/currency-manage-bundle
A Symfony bundle for managing currencies in your application, providing currency definitions, configuration, and integration for handling monetary data consistently across your project.
Install via Composer
composer require tourze/currency-manage-bundle
Note the -bundle suffix: this is a Symfony-style bundle, not a Laravel package with a ServiceProvider. Expect Doctrine entities, Symfony DI service definitions, and a *Bundle class rather than a *ServiceProvider.
Where to look first
src/ for the CurrencyManageBundle class, entity classes (e.g. Currency, ExchangeRate), and the manager/repository services.config/ (or Resources/config/) for services.yaml / XML definitions you'll need to translate into a Laravel provider.vendor/tourze/currency-manage-bundle/README.md — the 1.0.1 changelog is only a compare link, so source and README are your real documentation.Wire it into Laravel
The bundle has no extra.laravel.providers auto-discovery. Add a small app-level CurrencyServiceProvider that:
services.yaml),First use case: seed + convert
use Tourze\CurrencyManageBundle\Manager\CurrencyManager;
$manager = app(CurrencyManager::class);
$manager->importIsoCurrencies(); // if provided by the bundle
$amount = $manager->convert(100.00, 'USD', 'CNY');
The concrete method names depend on the bundle version — confirm against src/ before committing.
app(...) inline. This makes swapping in a fake trivial in tests.// app/Console/Kernel.php or routes/console.php
$schedule->call(fn () => app(CurrencyManager::class)->refreshRates())->hourly();
Decouple the fetch call from the conversion path so a flaky rate API never blocks checkout.Cache::remember("rate:USD:CNY", 300, ...)) — rate lookups are the hot path and the bundle won't cache for you.DECIMAL column, not floats. The bundle's entities may use float; audit and cast at your boundary.NumberFormatter (\NumberFormatter::CURRENCY) for display and let the bundle handle only the conversion math.setUp(); assert conversions against hand-checked pairs rather than live rates.composer require, nothing happens until you write a service provider and register the bundle's services manually. Budget for this.doctrine/dbal and either php artisan vendor:publish-style schema export or a hand-written migration matching the entity metadata. Verify column types (especially currency code length and rate precision).fetched_at alongside rates and expose it; conversions using stale rates should be flagged, not silently trusted.^1.0 but read the diff before assuming behavior is unchanged; no migration or BC notes were published.php artisan about and php artisan tinker to inspect the container; Symfony-style service IDs often differ from class names, so app(SomeClass::class) may miss — check the bundle's services.yaml for the exact ID.How can I help you explore Laravel packages today?