PHPackages                             rolice/laravel-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. [Database &amp; ORM](/categories/database)
4. /
5. rolice/laravel-currency

ActiveLibrary[Database &amp; ORM](/categories/database)

rolice/laravel-currency
=======================

Package that uses Yahoo! Finance API to get exchange rates and stores them in a database for further use.

02471PHP

Since May 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Rolice/LaravelCurrency)[ Packagist](https://packagist.org/packages/rolice/laravel-currency)[ RSS](/packages/rolice-laravel-currency/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Currency
================

[](#laravel-currency)

Laravel package that uses external API services to download rates and stores them in database for further use. This package is aiming to serve as currency conversions by extracting exchange rates and caching them in database and in high level cache engines.

Supported Framework Versions: **&gt;= 5.1**.

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

[](#installation)

To install the package you should require it from the composer repository. This is done either by executing a require command `coposer require rolice/laravel-currency` or by adding manually the requirement line in your `composer.json` like:

```
{
  "require": {
    "rolice/laravel-currency": "dev-master",
  },
}
```

When the package is installed in your project vendor directory you can easily enable the package via its service provider. To do this add a line in `config/app.php` in the section `providers` (an existing config array):

```
Rolice\LaravelCurrency\ServiceProvider::class
```

Now the package is turned on, but you should prepare the database and to publish package content:

`php artisan vendor:publish`

When the content is published you should edit `config/laravel-currency/laravel-currency.php` - the main package configuration file, particulary the `connection` setting where you should define the connection to the database you want to keep the information about currency rates. When you are ready with that you can execute table creation and setup with the help of the artisan command below.

`php artisan migrate`

The two lines above will publish configurations and migrations to the project directories - `config/` and `database/migrations`. After that the migration will be executed and new table will be created on the configured connection.

Now you are ready. The package is installed and ready for use.

Synchronization
---------------

[](#synchronization)

You can invoke a synchronization via executing the package command `Sync`. This is done with artisan like: `php artisan currency:sync`. You can set this command as scheduled with the comand `Kernel`.

```
// ...
class Kernel extends ConsoleKernel
  /**
   * The Artisan commands provided by your application.
   *
   * @var array
   */
  protected $commands = [
    // some other previously registered commands
    \Rolice\LaravelCurrency\Commands\Sync::class, // Add this line in the console kernel
  ];

  protected function schedule(Schedule $schedule)
  {
      // Register periodic schedule for the command like. You can specify interval by yourself.
      $schedule->command('currency:sync')->monthly();
  }
}
```

Usage
-----

[](#usage)

The package will define its own routes and controller by default - `/currency`. On it you can call a list of all currencies or call a conversion like: `/currency/convert?from=&to=&amount=`

The conversion will automatically convert the amount from the given currency to the targeted one. The amount parameter is optional, if ommitted it will default to `1` - the exact conversion rate. The currency codes are the official 3-character ISO code of the desired currency.

You will receive a JSON response with a number on success or object containing errors occurred on failure. Example for successful conversion is:

### Request

[](#request)

`http:///currency/convert?from=BGN&to=EUR`

### Response

[](#response)

```
0.509279
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/749cf1dfa9fd70be7bbcb900213e22ded804858f6e92baadabc6456536eb18ce?d=identicon)[rolice](/maintainers/rolice)

---

Top Contributors

[![Rolice](https://avatars.githubusercontent.com/u/1788956?v=4)](https://github.com/Rolice "Rolice (26 commits)")[![gentor](https://avatars.githubusercontent.com/u/2902504?v=4)](https://github.com/gentor "gentor (1 commits)")

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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