PHPackages                             otifsolutions/currency-layer - 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. [API Development](/categories/api)
4. /
5. otifsolutions/currency-layer

ActiveLibrary[API Development](/categories/api)

otifsolutions/currency-layer
============================

This Laravel package provides easy integration with Currency Layer Api along with complete list for countries with flag information. It also comes with command to auto sync rates for each currency

v1.0.1(3y ago)073MITPHP

Since May 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/otifsolutions/laravel-currency-layer)[ Packagist](https://packagist.org/packages/otifsolutions/currency-layer)[ RSS](/packages/otifsolutions-currency-layer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

### Laravel Currency Layer

[](#laravel-currency-layer)

This Laravel package provides easy integration with Currency Layer Api along with complete list for countries with flag information. It also comes with command to auto sync rates for each currency

**Requirements**

`PHP >= 7.4`

`Laravel >= 8.0`

**How to use the Library**

Install via **[Composer](https://getcomposer.org/download)** (Recommended)

**Using Composer**

```
composer require otifsolutions/currency-layer

```

**Note :**

> This package works with database engine `myIsam`. If you are using `mysql database` then you have to change database engine to `myIsam` from **config/database.php** -&gt; `'connection' => 'mysql'` and make this change `'engine' => 'myIsam'`

**Now, run the migrations**

```
php artisan migrate

```

**Then, run this command to populate all tables with countries, states, currencies etc data**

```
php artisan fill:tables

```

**Now follow the instructions below**

Grab the access key by registering on **[CurrencyLayer](https://currencylayer.com)**, give the key to the app using `artisan tinker` or by writing this line anywhere in the code, where `yourAccessKey` (string) is the key you've got from the API

```
OTIFSolutions\Laravel\Settings\Models\Setting::set('crlKey', 'yourAccessKey');
```

Set the `numberOfDays` key (positive integer), where this is the data of how many days you want to keep:

```
OTIFSolutions\Laravel\Settings\Models\Setting::set('daysRates', numberOfDays);
```

**Note:**

> To check what key you have set, try with `get` method like

```
OTIFSolutions\Laravel\Settings\Models\Setting::get('daysRates');
```

and

```
OTIFSolutions\Laravel\Settings\Models\Setting::get('crlKey');
```

If you have set the `crlKey` somewhere in the code, remove that line after first time execution. To reset or re-assign the key, you can use the same line. But, it is recommended to use tinker to set the access key.

**After setting all the things, you can now synchronize currency exchange rates data**

> Hit this command to fetch the exchange rates

```
php artisan rates:get

```

> Hit this command to remove the exchange rates

```
php artisan rates:delete

```

> Now publish countries flags from package to your project

```
php artisan publish:flags

```

**Note :**

> Commands `rates:delete` and `rates:get` can only be executed when you set the keys `crlKey` and `daysRates`

**Relationships defined between Models**

Model **Country** has `OneToOne` relation and `Currency`, `ManyToMany` relation with `Timezone` and `OneToMany` relation with `State`.

**State** Model has `OneToMany` relation with `City`

**Currency** Model has `OneToMany` relation with `CurrencyRate`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.1% 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 ~1 days

Total

2

Last Release

1448d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f9aeabc454ee05b530e6234f1689a89e8f63bc766e647ad78bec54add4215b4?d=identicon)[otifsolutions](/maintainers/otifsolutions)

---

Top Contributors

[![danish9811](https://avatars.githubusercontent.com/u/100212323?v=4)](https://github.com/danish9811 "danish9811 (103 commits)")[![danish981](https://avatars.githubusercontent.com/u/42686972?v=4)](https://github.com/danish981 "danish981 (1 commits)")[![junaidmaqbutt](https://avatars.githubusercontent.com/u/13379343?v=4)](https://github.com/junaidmaqbutt "junaidmaqbutt (1 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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