Currencies
Every Money carries a Currency — a readonly value with code, exponent, name, symbol, numericCode and iso. The registry is seeded with the bundled ISO 4217 list: 165 currencies from SIX List One (published 2026-09-17) with CLDR 47 English symbols.
use RoundlyConsulting\Money\Currency;
use RoundlyConsulting\Money\Facades\Currencies;
Currencies::get('EUR')->exponent; // 2
Currencies::find('XYZ'); // null
Currencies::has('JPY'); // true
Currencies::findByNumericCode(978); // EUR
Currency::of('bhd')->numericCodeString(); // "048" — lookups trim and upper-case
Currency::of('JPY')->exponent; // 0
Currency::of('EUR')->minorPerMajor(); // "100"
Currency::of('USD')->displaySymbol(); // "$"
Currency::of('CHF')->displaySymbol(); // "CHF" — the code when there is no symbol
Currencies::iso(); Currencies::custom(); Currencies::all();Custom currencies
Add points, credits or crypto with up to 18 decimals — in config:
// config/money.php
'currencies' => [
'iso' => true,
'custom' => [
'PTS' => ['exponent' => 0, 'name' => 'Loyalty points', 'symbol' => 'pts'],
'BTC' => ['exponent' => 8, 'symbol' => '₿'],
'ETH' => ['exponent' => 18, 'symbol' => 'Ξ'],
],
'allowed' => ['EUR', 'USD', 'CZK'], // currencies users may pick
],…or in a service provider’s boot():
// In a service provider's boot()
Currencies::register(Currency::custom('ETH', 18, 'Ether', 'Ξ'));
Currencies::register(Currency::custom('PTS', 0, 'Loyalty points', 'pts'));
Money::ofMajor('1.5', 'ETH')->minor(); // "1500000000000000000"
Money::ofMinor(1200, 'PTS')->format('en_US'); // "pts 1,200"- ISO currencies can never be redefined — CurrencyAlreadyRegistered.
- Custom codes are 2–10 characters (a letter, then letters or digits), exponent 0..18, and must fit schema.currency_length — raise it before migrating for codes such as USDT.
- Re-registering an existing custom code needs replace: true.
- Identity is code + exponent: a hand-built Currency('EUR', 3, …) is a different currency, and arithmetic between the two throws.
- Register at boot only — Octane workers share the registry singleton.
- Withdrawn codes (HRK, SKK, BGN) are not bundled; register them as custom currencies if you need historic data.
Restricting input currencies
currencies.allowed limits which currencies users may choose — it drives the CurrencyCode rule and MoneyAmount::inCurrencyFrom() — without ever restricting data you already store.
Listing the registry
php artisan money:currencies # the whole registry
php artisan money:currencies --iso # only bundled ISO 4217 currencies
php artisan money:currencies --custom # only custom currencies
php artisan money:currencies --code=USD --code=CZKWithout the facade, inject the RoundlyConsulting\Money\Contracts\CurrencyRegistry contract — the same singleton Currencies resolves.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.