PHPackages                             mattyeend/currency-exchange - 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. mattyeend/currency-exchange

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

mattyeend/currency-exchange
===========================

A Laravel package for currency exchange rates

v1.1.7(1mo ago)14MITPHPPHP &gt;=8.1

Since Jan 28Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/MatthewYeend/Currency-Exchange)[ Packagist](https://packagist.org/packages/mattyeend/currency-exchange)[ Fund](https://www.buymeacoffee.com/mattyeend)[ GitHub Sponsors](https://github.com/MattYeend)[ RSS](/packages/mattyeend-currency-exchange/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (10)Used By (0)

Currency Exchange Laravel Package
=================================

[](#currency-exchange-laravel-package)

The `CurrencyExchange` package provides a simple and efficient way to retrieve currency exchange rates and perform currency conversions in your Laravel applications. Integrates with the [ExchangeRate API](https://www.exchangerate-api.com) for reliable and up-to-date data.

---

Features
--------

[](#features)

- Retrieve real-time exchange rates for any support currency.
- Perform currency conversions between two currencies.
- Easily configurable with a default base currency and API key.
- Includes a frontend UI for fetching rates and performing conversions.
- Lightweight and extensible, suitable for any Laravel application.

---

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

[](#installation)

### Step 1

[](#step-1)

```
composer require mattyeend/currency-exchange
```

### Step 2

[](#step-2)

Publish the package configuration file to customise settings like the API key and base currency:

```
php artisan vendor:publish --tag=config --provider="MattYeend\CurrencyExchange\CurrencyExchangeServiceProvider"
```

This will create a `currencyexchange.php` configuration file in your `config` directory.

### Step 3

[](#step-3)

Add your ExchangeRate API key to your `.env` file:

```
EXCHANGERATE_API_KEY=your_api_key
```

---

Usage
-----

[](#usage)

### Fetch Exchange Rates

[](#fetch-exchange-rates)

You can fetch exchange rates programmatically using the `CurrencyExchangeService`:

```
use MattYeend\CurrencyExchange\Services\CurrencyExchangeService;

$service = app(CurrencyExchangeService::class);
$rates = $service->getRates('GBP'); // Replace 'GBP' with your base currency

dd($rates); // Outputs an array of exchange rates
```

### Convert Currency

[](#convert-currency)

Perform a currency conversion between two currencies:

```
$convertedAmount = $service->convert(100, 'GBP', 'EUR');

echo "Converted Amount: $convertedAmount";
```

---

Routes
------

[](#routes)

The package includes predefined routes for fetching exchange rates and performing conversions:

- View Exchange Rates: GET `/currency-exchange`Displays a basic UI for fetching and displaying rates.
- Get Rates (API); GET `/currency-exchange/rates`Returns exchange rates for a specific base currency.
- Convert Currency (API): POST `/currency-exchange/convert`Accepts `amount`, `from`, and `to` parameters and returns the converted amount.

---

Views
-----

[](#views)

A basic UI is included for quick usage. Visit `/currency-exchange` to view rates and use the conversion form. To customise the view, edit the Blade template at: `resources/views/vendor/currencyexchange/index.blade.php`

---

Testing
-------

[](#testing)

The package includes unit and feature tests. Run the tests using PHPUnit:

```
php artisan test
```

---

Configuration
-------------

[](#configuration)

The following configuration options are available in `config/currencyexchange.php`:

```
return [
    'api_key' -> env('EXCHANGERATE_API_KEY', 'your_api_key'),
    'base_currency' => 'GBP'
];
```

---

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

---

Contributing
------------

[](#contributing)

Feel free to fork the repository and submit pull requests for improvements or new features!

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance88

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~68 days

Recently: every ~50 days

Total

7

Last Release

59d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/280b020ca627b367261832c86f63f9f71076d720e1f8e6c4a7ae2c9c1a77f39e?d=identicon)[MattYeend](/maintainers/MattYeend)

---

Top Contributors

[![MattYeend](https://avatars.githubusercontent.com/u/23270321?v=4)](https://github.com/MattYeend "MattYeend (8 commits)")

---

Tags

composercomposer-packagecurrencycurrency-exchangecurrency-exchange-ratesexchangeexchange-rateslaravellaravel-10laravel-11laravel-12laravel-13laravel-frameworklaravel-packagelaravel10laravel11laravel12laravel13packagephplaravelcurrencypackagelaravel-packageexchangeexchange ratescurrency-exchange

### Embed Badge

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

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)

PHPackages © 2026

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