PHPackages                             notchafrica/laravel-toolkit - 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. notchafrica/laravel-toolkit

ActiveLibrary

notchafrica/laravel-toolkit
===========================

This is my package laravel-toolkit

2.1.2(2y ago)019MITPHPPHP ^8.1

Since Sep 20Pushed 2y agoCompare

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

READMEChangelog (10)Dependencies (13)Versions (11)Used By (0)

Laravel-toolkit
===============

[](#laravel-toolkit)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

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

[](#installation)

You can install the package via composer:

```
composer require notchafrica/laravel-toolkit
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="laravel-toolkit-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-toolkit-config"
```

This is the contents of the published config file:

```
return [
    "currency" => [
        'default' => 'USD',

        /*
        |--------------------------------------------------------------------------
        | API Key for FOREXAPI
        |--------------------------------------------------------------------------
        |
        | Only required if you with to use the Open Exchange Rates api. You can
        | always just use Yahoo, the current default.
        |
        */

            'api_key' => env(
                "RESTUNIVERE_API_KEY",
            ),

        /*
        |--------------------------------------------------------------------------
        | Default Storage Driver
        |--------------------------------------------------------------------------
        |
        | Here you may specify the default storage driver that should be used
        | by the framework.
        |
        | Supported: "database", "filesystem", "Model"
        |
        */

            'driver' => 'filesystem',

        /*
        |--------------------------------------------------------------------------
        | Default Storage Driver
        |--------------------------------------------------------------------------
        |
        | Here you may specify the default cache driver that should be used
        | by the framework.
        |
        | Supported: all cache drivers supported by Laravel
        |
        */

        'cache_driver' => null,

        /*
        |--------------------------------------------------------------------------
        | Storage Specific Configuration
        |--------------------------------------------------------------------------
        |
        | Here you may configure as many storage drivers as you wish.
        |
        */

        'drivers' => [

            'database' => [
                'class' => \Notch\Toolkit\Currency\Drivers\Database::class,
                'connection' => null,
                'table' => 'currencies',
            ],

            'filesystem' => [
                'class' => \Notch\Toolkit\Currency\Drivers\Filesystem::class,
                'disk' => "local",
                'path' => 'currencies.json',
            ],

            'model' => [
                'table' => 'currencies',
                'class' => \Notch\Toolkit\Currency\Models\Currency::class
            ],

        ],

        /*
        |--------------------------------------------------------------------------
        | Currency Formatter
        |--------------------------------------------------------------------------
        |
        | Here you may configure a custom formatting of currencies. The reason for
        | this is to help further internationalize the formatting past the basic
        | format column in the table. When set to `null` the package will use the
        | format from storage.
        |
        |
        */

        'formatter' => null,

        /*
        |--------------------------------------------------------------------------
        | Currency Formatter Specific Configuration
        |--------------------------------------------------------------------------
        |
        | Here you may configure as many currency formatters as you wish.
        |
        */

        'formatters' => [

            'php_intl' => [
                'class' => \Notch\Toolkit\Currency\Formatters\PHPIntl::class,
            ],

        ],
    ]
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="laravel-toolkit-views"
```

Currency
--------

[](#currency)

The Laravel Currency Toolkit makes it easy to implement multi-currency pricing into your application and store the exchange data for fast real-time conversions.

### Usage

[](#usage)

The simplest way to use these methods is through the helper function `currency()` or by using the facade. For the examples below we will use the helper method.

#### Converting

[](#converting)

This is a shortcut to the most commonly used `convert` method, which converts the given amount into the provided currency.

```
currency($amount, $from = null, $to = null, $format = true)
```

**Arguments:**

`$amount` - The float amount to convert `$from` - The current currency code of the amount. If not set, the application default will be used (see `config/notchpay-toolkit.php` file). `$to` - The currency code to convert the amount to. If not set, the user-set currency is used. `$format` - Should the returned value be formatted.

**Usage:**

```
echo currency(12.00);               // Will format the amount using the user selected currency
echo currency(12.00, 'USD', 'EUR'); // Will format the amount from the default currency to EUR
```

#### Formatting

[](#formatting)

Quickly parse a given amount into the proper currency format. This is a shortcut to the most commonly used `format` method.

```
currency_format($amount, $code = null)
```

### Manage

[](#manage)

Easily add, update, or delete currencies from the default storage. This is extremely helpful when there are changes to currency data, such as symbols and such.

```
php artisan currency:

```

**Arguments:**

```
 action              Action to perform (hydrate, seed, or cleanup)

```

### Seed

[](#seed)

Used to seed currencies in local database

```
php artisan currency:seed
```

### Updating Exchange

[](#updating-exchange)

Update exchange rates from restuniverse.com An API key is needed to use [Rest Universe](http://restuniverse.com). Add yours to the config file.

```
php artisan currency:hydrate
```

> Note: Yahoo has discontinued the use of their exchange rate API, so it has been removed from the package.

### Cleanup

[](#cleanup)

Used to clean the Laravel cached exchanged rates and refresh it from the database. Note that cached exchanged rates are cleared after they are updated using one of the command above.

```
php artisan currency:cleanup
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [chapdel](https://github.com/chapdel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

10

Last Release

1052d ago

Major Versions

1.5 → 2.02023-06-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20987014?v=4)[Chapdel KAMGA](/maintainers/chapdel)[@chapdel](https://github.com/chapdel)

---

Top Contributors

[![chapdel](https://avatars.githubusercontent.com/u/20987014?v=4)](https://github.com/chapdel "chapdel (9 commits)")

---

Tags

laravelmoneycurrencyfinanceexchange rateExchange Rates APInotchpaynotchpay-toolkit

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/notchafrica-laravel-toolkit/health.svg)

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

###  Alternatives

[torann/currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.

4081.1M6](/packages/torann-currency)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)

PHPackages © 2026

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