Search by

fomvasss / laravel-currency

fomvasss

Laravel package for working with multiple currencies, providing currency conversion, exchange rate management, and formatted output

Package info

github.com/fomvasss/laravel-currency

pkg:composer/fomvasss/laravel-currency

Statistics

Installs: 373

Dependents: 0

Suggesters: 1

Stars: 3

Open Issues: 0

2.8.1 2026-10-07 16:05 UTC

This package is auto-updated.

Last update: 2026-10-07 16:53:16 UTC


README

License Latest Stable Version Total Downloads

Currency conversion, exchange rates and money formatting for Laravel. Rates come from pluggable providers — Monobank, PrivatBank, NBU, jsDelivr currency-api, ExchangeRatesAPI, CurrencyAPI, Fixer, or your own — and are cached with a fallback for when the API is down.

Українською

  • Conversion with buy / sell / average rates
  • Seven built-in providers, switchable at runtime, plus custom ones via a small contract
  • Historical rates — convert at the rate of a past date
  • Base currency override with automatic rate recalculation
  • Caching with a long-term fallback cache and a CurrencyRateFetchFailed event
  • Formatting with symbol, precision and separators per currency
  • Helpers, Blade directives, currency:rates and currency:convert commands

Requirements

  • PHP ^8.1
  • Laravel 9 – 13

Installation

composer require fomvasss/laravel-currency

php artisan vendor:publish --tag=currency-config
CURRENCY_DEFAULT_PROVIDER=monobank

Quick start

use Fomvasss\Currency\Facades\Currency;

Currency::convert(100, 'USD', 'UAH');          // average rate
Currency::convert(100, 'USD', 'UAH', 'sell');
Currency::getRate('EUR');                      // UAH per 1 EUR
Currency::format(1234.5, 'USD');               // "$ 1,234.50"

Currency::useProvider('nbu')->convertAt(100, 'USD', 'UAH', now()->subYear());
php artisan currency:rates --provider=nbu
php artisan currency:convert 100 usd eur --format

Documentation

Online: https://fomvasss.github.io/laravel-currency/ — the same pages as in docs/.

License

MIT — see LICENSE.

Support

If this package is useful to you, consider supporting its development:

Monobank Ko-Fi USDT TRC20

USDT TRC20 address: THLgp6DxiAtbNHvgnKV56vk1L38UuUagKf