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

ActiveLibrary

khetamhamdy/currency-exchange
=============================

A Laravel package for currency exchange and transaction management.

401PHP

Since Jan 7Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

Introduction
------------

[](#introduction)

The **Currency Exchange** package is an open-source PHP library for Laravel that simplifies managing currency exchange operations and transactions. If your application involves working with currencies or financial transactions between currencies, this package provides an efficient solution.

This package is dedicated to my late father, and I hope it helps improve the software development experience.

Features
--------

[](#features)

- Manage **currencies**: Add, update, delete, and view currencies.
- Manage **exchange transactions**: Add, update, view exchange transactions.
- Flexible API for currency and transaction data in JSON format.
- Easy to use and works seamlessly with **Laravel 9.0+**.

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

Install the package in your Laravel application by running the following command in your project directory:

```
composer require khetamhamdy/currency-exchange
```

### 2. Add the Service Provider (if needed)

[](#2-add-the-service-provider-if-needed)

If you're not using Laravel's package auto-discovery feature, add the service provider manually in the `config/app.php` file under the `providers` array:

```
'providers' => [
    // Other providers...
    KhetamHamdy\CurrencyExchange\Providers\CurrencyExchangeServiceProvider::class,
],
```

### 3. Run Migrations

[](#3-run-migrations)

To create the necessary database tables, execute the following command:

```
php artisan migrate
```

This will run the migrations provided by the package to set up the required database schema.

Usage
-----

[](#usage)

### 1. Currency Management

[](#1-currency-management)

#### Display All Currencies:

[](#display-all-currencies)

```
use KhetamHamdy\CurrencyExchange\Services\CurrencyService;

$currencyService = app('currency.service');
$currencies = $currencyService->getAllCurrencies();
```

#### Add a New Currency:

[](#add-a-new-currency)

```
$currencyService->addCurrency([
    'name' => 'US Dollar',
    'code' => 'USD',
]);
```

#### Update a Currency:

[](#update-a-currency)

```
$currencyService->updateCurrency($id, [
    'name' => 'Euro',
    'code' => 'EUR',
]);
```

#### Delete a Currency:

[](#delete-a-currency)

```
$currencyService->deleteCurrency($id);
```

### 2. Transaction Management

[](#2-transaction-management)

#### Display All Transactions:

[](#display-all-transactions)

```
use KhetamHamdy\CurrencyExchange\Services\ExchangeTransactionService;

$exchangeService = app('exchange.service');
$transactions = $exchangeService->listTransactions();
```

#### Add a New Transaction:

[](#add-a-new-transaction)

```
$exchangeService->createTransaction([
    'from' => 1, // Original currency ID
    'to' => 2,   // Target currency ID
    'rate' => 1.2,
    'date' => now(),
]);
```

#### Update a Transaction:

[](#update-a-transaction)

```
$exchangeService->updateTransaction($id, [
    'from' => 1,
    'to' => 2,
    'rate' => 1.3,
    'date' => now(),
]);
```

Notes
-----

[](#notes)

- Ensure your application meets the package requirements, including Laravel version 9.0 or higher.
- Remember to run `php artisan migrate` after installing the package to set up the database tables.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5373acc5513116112264905c7a98f685997f0914d96677c55f9c5a0f5a664b03?d=identicon)[khetamHamdy](/maintainers/khetamHamdy)

---

Top Contributors

[![khetamHamdy](https://avatars.githubusercontent.com/u/89257196?v=4)](https://github.com/khetamHamdy "khetamHamdy (7 commits)")

### Embed Badge

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

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

PHPackages © 2026

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