adolfoholzer / currency
A lightweight Laravel package that centralizes currency definitions across your applications.
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/support: ^12.0||^13.0
Requires (Dev)
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0||^11.0
- pestphp/pest: ^4.6||^5.0
- pestphp/pest-plugin-laravel: ^4.1||^5.0
- pestphp/pest-plugin-type-coverage: ^4.0||^5.0
- phpstan/extension-installer: ^1.4
This package is not auto-updated.
Last update: 2026-08-12 23:34:30 UTC
README
Currency
A lightweight Laravel package that centralizes currency definitions across your applications.
Installation
You can install the package via Composer:
composer require adolfoholzer/currency
You may publish all of the package's resources at once:
php artisan vendor:publish --tag="currency"
Or, you may publish each resource individually:
Publishing the Configuration File
php artisan vendor:publish --tag="currency-config"
Usage
Getting the default currency
use Zitro\Currency\Facades\Currency; $currency = Currency::default();
Using the enum
use Zitro\Currency\Enums\CurrencyType; $currency = CurrencyType::USD;
Example:
$currency->code(); $currency->symbol();
Examples
Currency code
CurrencyType::USD->code(); // USD
Currency symbol
CurrencyType::USD->symbol(); // $
Comparing currencies
if ($currency === CurrencyType::USD) { // }
Available currencies
The package currently supports the following currencies:
| Currency | ISO Code |
|---|---|
| Uruguayan Peso | UYU |
| US Dollar | USD |
| Euro | EUR |
More currencies can easily be added by extending the
CurrencyTypeenum.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Thank you for considering contributing to Currency! Please review our contributing guide to get started.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
Currency is open-sourced software licensed under the MIT license.