PHPackages                             shipsaas/currency-fx - 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. shipsaas/currency-fx

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

shipsaas/currency-fx
====================

A PHP Library handles Currency FX from multiple online FX services. Battery-included.

1.0.0(3y ago)297MITPHPPHP ^8.1|^8.2

Since Apr 17Pushed 3y agoCompare

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

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

PHP Currency FX Library
=======================

[](#php-currency-fx-library)

[![codecov](https://camo.githubusercontent.com/b8c5c7754d9ee879841fff115682c00f0acb4edcfcd363578cab5336567132b0/68747470733a2f2f636f6465636f762e696f2f67682f73686970736161732f63757272656e63792d66782f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d5331524139584b553934)](https://codecov.io/gh/shipsaas/currency-fx)[![Unit Test (PHP 8.1, 8.2)](https://github.com/shipsaas/currency-fx/actions/workflows/unit.yml/badge.svg)](https://github.com/shipsaas/currency-fx/actions/workflows/unit.yml)[![Integration Test](https://github.com/shipsaas/currency-fx/actions/workflows/integration.yml/badge.svg)](https://github.com/shipsaas/currency-fx/actions/workflows/integration.yml)[![E2E Test](https://github.com/shipsaas/currency-fx/actions/workflows/e2e.yml/badge.svg)](https://github.com/shipsaas/currency-fx/actions/workflows/e2e.yml)

A PHP Library handles Currency FX (rates &amp; conversions) with ease. Battery-included 🔋🔋🔋.

Available for Laravel too.

Tired of implementing these and integrate with 3rd services? Let's CurrencyFX help you to do that. Covered by Unit Testing &amp; battle-tested!

Available Services / Batteries
------------------------------

[](#available-services--batteries)

-
-
-
-
-

Supports
--------

[](#supports)

- PHP 8.1+

Dependencies
------------

[](#dependencies)

- Guzzle for API Requests
- [NeverThrow](https://github.com/shipsaas/never-throw) for straightforward OK/Error response.

Usage
-----

[](#usage)

Simply initialize the class with the required params. And it is ready to use in no time.

```
$service = new CurrencyCloudService($host, $loginId, $apiKey);
$rateResponse = $service->getRates('USD', 'SGD');

if (!$rateResponse->isOk()) {
    // failed to get the rate from third party service
    // do something here
}

$rate = $rateResponse->getOkResult()->rate; // float (1.4xxx)
```

Laravel Integration
-------------------

[](#laravel-integration)

Requirement: Laravel 10+

Just simply install the package and lets Laravel discovery magic happens 🥰

Since we already bind the services in Laravel Container, all you have to do is update the ENVs and that's all.

### Export the configuration

[](#export-the-configuration)

```
php artisan vendor:publish --tag=currency-fx-configs
```

### Update ENVs

[](#update-envs)

After published the config, checkout the `configs/currency-fx.php`.

We already defined some ENVs key for you to add 😜.

### Usage

[](#usage-1)

```
use CurrencyFX\Services\CurrencyLayerService;
use CurrencyFX\Services\ExchangerRatesApiIoService;

// global access
app(CurrencyLayerService::class)->getRates('USD', 'EUR');

// DI
class TransferService
{
    public function __construct(
        private ExchangerRatesApiIoService $rateService
    ) {
    }

    public function transfer(): TransferResult
    {
        $rateRes = $this->rateService->getRates('EUR', 'GBP');
        if ($rateRes->isError()) {
            return TransferResult::error(...);
        }

        $rate = $rateRes->getOkResult()->rate;
    }
}
```

Tests
-----

[](#tests)

We love tests, always. We have 3 kind of test cases:

- Unit Tests
- Integration Tests
- E2E Tests

Check out the [TEST-README.md](./tests/README.md) to learn more!

Contribute to the project
-------------------------

[](#contribute-to-the-project)

- All changes must follow PSR-1 / PSR-12 coding conventions.
- Unit testing is a must, cover things as much as you can.

Feel free to add more driver and share it to the whole PHP community 😆

This library is useful?
-----------------------

[](#this-library-is-useful)

Thank you, please give it a ⭐️⭐️⭐️ to support the project.

Don't forget to share with your friends &amp; colleagues, so they can also build their own SaaS products as well 🚀

License
-------

[](#license)

MIT LICENSE

Contributors
------------

[](#contributors)

ShipSaas, Seth Phat &amp; Contributors

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

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

Unknown

Total

1

Last Release

1172d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23478115?v=4)[Seth Phat](/maintainers/sethsandaru)[@sethsandaru](https://github.com/sethsandaru)

---

Top Contributors

[![sethsandaru](https://avatars.githubusercontent.com/u/23478115?v=4)](https://github.com/sethsandaru "sethsandaru (14 commits)")

---

Tags

currency-exchangecurrency-rateslaravellaravel-libraryphpphp-librarycurrencylibraryexchange ratesPHP Libraryfxfx\_rateslaravel-librarycurrency rates

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[firefly-iii/data-importer

Firefly III Data Import Tool.

8015.8k](/packages/firefly-iii-data-importer)[oat-sa/tao-core

TAO core extension

66143.7k120](/packages/oat-sa-tao-core)[ujjwal/currency-converter

Currency Converter Class with features of caching and identifying currency from country Code

49230.5k](/packages/ujjwal-currency-converter)

PHPackages © 2026

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