PHPackages                             restuniverse/currency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. restuniverse/currency

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

restuniverse/currency
=====================

This package provides Laravel functions such as currency formatting and conversion using up-to-date exchange rates.

v2.3(3y ago)1348BSD-2-ClausePHPPHP ^7.2|^8.0

Since Dec 9Pushed 3y agoCompare

[ Source](https://github.com/notchpay/currency)[ Packagist](https://packagist.org/packages/restuniverse/currency)[ RSS](/packages/restuniverse-currency/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (7)Versions (8)Used By (0)

Rest Universe Currency
======================

[](#rest-universe-currency)

Installation
------------

[](#installation)

- [Currency on Packagist](https://packagist.org/packages/notchpay/currency)
- [Currency on GitHub](https://github.com/notchpay/currency)

### Composer

[](#composer)

From the command line run:

```
$ composer require restuniverse/currency
```

### Laravel's &gt;=5.5 Auto-Discovery

[](#laravels-55-auto-discovery)

Simply install the package and let Laravel do its magic.

### Manual Setup

[](#manual-setup)

Once installed you need to register the service provider with the application. Open up `config/app.php` and find the `providers` key.

```
'providers' => [

    \RestUniverse\Currency\CurrencyServiceProvider::class,

]
```

This package also comes with a facade, which provides an easy way to call the the class. Open up `config/app.php` and find the `aliases` key.

```
'aliases' => [

    'Currency' => \RestUniverse\Currency\Facades\Currency::class,

];
```

### Publish the configurations

[](#publish-the-configurations)

Run this on the command line from the root of your project:

```
php artisan vendor:publish --provider="RestUniverse\Currency\CurrencyServiceProvider" --tag=config
```

A configuration file will be published to `config/currency.php`.

### Migration

[](#migration)

If currencies are going to be stored in the database.

```
php artisan vendor:publish --provider="RestUniverse\Currency\CurrencyServiceProvider" --tag=migrations
```

Run this on the command line from the root of your project to generate the table for storing currencies:

```
$ php artisan migrate
```

> note: Add your API\_KEY to the .env file with (REST\_UNIVERSE\_API\_KEY).

Basic usage
-----------

[](#basic-usage)

The simplest way to use these methods is through the helper function `currency()` or by using the facade. For the examples below we will use the helper method.

```
currency($amount, $from = null, $to = null, $format = true)
```

**Arguments:**

`$amount` - The float amount to convert `$from` - The current currency code of the amount. If not set, the application default will be used (see `config/currency.php` file). `$to` - The currency code to convert the amount to. If not set, the user-set currency is used. `$format` - Should the returned value be formatted.

**Usage:**

```
echo currency(12.00);               // Will format the amount using the user selected currency
echo currency(12.00, 'USD', 'EUR'); // Will format the amount from the default currency to EUR
```

### Updating Exchange Rates

[](#updating-exchange-rates)

Update exchange rates from restuniverse.com. An API key is needed to use [Rest Universe](http://restuniverse.com). Add yours to the config file.

```
php artisan currency:hydrate
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~58 days

Total

7

Last Release

1378d ago

Major Versions

v1.2 → v2.02022-01-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20987014?v=4)[Chapdel KAMGA](/maintainers/chapdel)[@chapdel](https://github.com/chapdel)

---

Top Contributors

[![chapdel](https://avatars.githubusercontent.com/u/20987014?v=4)](https://github.com/chapdel "chapdel (10 commits)")

---

Tags

laravelmoneycurrencyopenexchangeratesfinanceexchange rateExchange Rates API

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/restuniverse-currency/health.svg)

```
[![Health](https://phpackages.com/badges/restuniverse-currency/health.svg)](https://phpackages.com/packages/restuniverse-currency)
```

###  Alternatives

[torann/currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.

4081.1M6](/packages/torann-currency)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[cknow/laravel-money

Laravel Money

1.0k4.3M22](/packages/cknow-laravel-money)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[casinelli/currency

Handles currency for Laravel 5.

1911.8k](/packages/casinelli-currency)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
