PHPackages                             akaunting/laravel-money - 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. akaunting/laravel-money

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

akaunting/laravel-money
=======================

Currency formatting and conversion package for Laravel

6.0.3(1mo ago)7825.3M—3.4%110[2 PRs](https://github.com/akaunting/laravel-money/pulls)16MITPHPPHP ^8.2CI passing

Since Nov 26Pushed 1mo ago15 watchersCompare

[ Source](https://github.com/akaunting/laravel-money)[ Packagist](https://packagist.org/packages/akaunting/laravel-money)[ RSS](/packages/akaunting-laravel-money/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (45)Used By (16)

Currency formatting and conversion package for Laravel
======================================================

[](#currency-formatting-and-conversion-package-for-laravel)

[![Downloads](https://camo.githubusercontent.com/4407d0de47c74678e7108e71eb67eedd8f5002797a67556a7cc2535d8487cab3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b61756e74696e672f6c61726176656c2d6d6f6e6579)](https://camo.githubusercontent.com/4407d0de47c74678e7108e71eb67eedd8f5002797a67556a7cc2535d8487cab3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b61756e74696e672f6c61726176656c2d6d6f6e6579)[![Tests](https://camo.githubusercontent.com/821331ff4b4f150c7dfa14dce766188f53694dffd7f1161678c88a67136f0902/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b61756e74696e672f6c61726176656c2d6d6f6e65792f74657374732e796d6c3f6c6162656c3d7465737473)](https://camo.githubusercontent.com/821331ff4b4f150c7dfa14dce766188f53694dffd7f1161678c88a67136f0902/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616b61756e74696e672f6c61726176656c2d6d6f6e65792f74657374732e796d6c3f6c6162656c3d7465737473)[![StyleCI](https://camo.githubusercontent.com/58789554dbb390b1f3e1230047ab49c0ed3fc4f965d2f365a2ccbfbe428ff5f2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3131323132313530382f736869656c643f7374796c653d666c6174266272616e63683d6d6173746572)](https://styleci.io/repos/112121508)[![License](https://camo.githubusercontent.com/a5016802cdb5a6ba6a9870d0f5915748ffee5d0692cc7189c4daf057faff456a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b61756e74696e672f6c61726176656c2d6d6f6e6579)](LICENSE.md)

This package intends to provide tools for formatting and conversion of monetary values in an easy, yet powerful way for Laravel projects.

### Why not use the `moneyphp` package?

[](#why-not-use-the-moneyphp-package)

Because it uses the `intl` extension for number formatting. `intl` extension isn't present by default on PHP installs and can give [different results](http://moneyphp.org/en/latest/features/formatting.html#intl-formatter) in different servers.

Getting Started
---------------

[](#getting-started)

### 1. Install

[](#1-install)

Run the following command:

```
composer require akaunting/laravel-money
```

### 2. Publish

[](#2-publish)

Publish config file.

```
php artisan vendor:publish --tag=money
```

### 3. Configure

[](#3-configure)

You can change the currencies information of your app from `config/money.php` file

Usage
-----

[](#usage)

```
use Akaunting\Money\Currency;
use Akaunting\Money\Money;

echo Money::USD(500); // '$5.00' unconverted
echo new Money(500, new Currency('USD')); // '$5.00' unconverted
echo Money::USD(500, true); // '$500.00' converted
echo new Money(500, new Currency('USD'), true); // '$500.00' converted
```

### Advanced

[](#advanced)

```
$m1 = Money::USD(500);
$m2 = Money::EUR(500);

$m1->getCurrency();
$m1->isSameCurrency($m2);
$m1->compare($m2);
$m1->equals($m2);
$m1->greaterThan($m2);
$m1->greaterThanOrEqual($m2);
$m1->lessThan($m2);
$m1->lessThanOrEqual($m2);
$m1->convert(Currency::GBP(), 3.5);
$m1->add($m2);
$m1->subtract($m2);
$m1->multiply(2);
$m1->divide(2);
$m1->allocate([1, 1, 1]);
$m1->isZero();
$m1->isPositive();
$m1->isNegative();
$m1->format();
```

### Helpers

[](#helpers)

```
money(500)
money(500, 'USD')
currency('USD')
```

### Blade Directives

[](#blade-directives)

```
@money(500)
@money(500, 'USD')
@currency('USD')
```

### Blade Component

[](#blade-component)

Same as the directive, there is also a `blade` component for you to create money and currency in your views:

```

or

or

```

### Macros

[](#macros)

This package implements the Laravel `Macroable` trait, allowing macros and mixins on both `Money` and `Currency`.

Example use case:

```
use Akaunting\Money\Currency;
use Akaunting\Money\Money;

Money::macro(
    'absolute',
    fn () => $this->isPositive() ? $this : $this->multiply(-1)
);

$money = Money::USD(1000)->multiply(-1);

$absolute = $money->absolute();
```

Macros can be called statically too:

```
use Akaunting\Money\Currency;
use Akaunting\Money\Money;

Money::macro('zero', fn (?string $currency = null) => new Money(0, new Currency($currency ?? 'GBP')));

$money = Money::zero();
```

### Mixins

[](#mixins)

Along with Macros, Mixins are also supported. This allows merging another classes methods into the Money or Currency class.

Define the mixin class:

```
use Akaunting\Money\Money;

class CustomMoney
{
    public function absolute(): Money
    {
        return $this->isPositive() ? $this : $this->multiply(-1);
    }

    public static function zero(?string $currency = null): Money
    {
        return new Money(0, new Currency($currency ?? 'GBP'));
    }
}
```

Register the mixin, by passing an instance of the class:

```
Money::mixin(new CustomMoney);
```

The methods from the custom class will be available:

```
$money = Money::USD(1000)->multiply(-1);
$absolute = $money->absolute();

// Static methods via mixins are supported too:
$money = Money::zero();
```

Changelog
---------

[](#changelog)

Please see [Releases](../../releases) for more information on what has changed recently.

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

[](#contributing)

Pull requests are more than welcome. You must follow the PSR coding standards.

Security
--------

[](#security)

Please review [our security policy](https://github.com/akaunting/laravel-money/security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Denis Duliçi](https://github.com/denisdulici)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

75

—

ExcellentBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity67

Solid adoption and visibility

Community42

Growing community involvement

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 59.4% 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 ~72 days

Recently: every ~136 days

Total

43

Last Release

56d ago

Major Versions

1.2.3 → 2.0.02022-01-18

2.1.0 → 3.0.02022-04-27

3.1.2 → 4.0.02023-02-14

4.0.1 → 5.0.02023-07-10

5.2.2 → 6.0.02025-02-08

PHP version history (5 changes)1.0.0PHP &gt;=5.5.9

1.1.0PHP &gt;=5.6.4

2.0.0PHP &gt;=8.0

3.0.0PHP ^8.0

6.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5254835?v=4)[Denis Dulici](/maintainers/denisdulici)[@denisdulici](https://github.com/denisdulici)

![](https://avatars.githubusercontent.com/u/10936547?v=4)[Cüneyt Şentürk](/maintainers/cuneytsenturk)[@cuneytsenturk](https://github.com/cuneytsenturk)

---

Top Contributors

[![denisdulici](https://avatars.githubusercontent.com/u/5254835?v=4)](https://github.com/denisdulici "denisdulici (104 commits)")[![cuneytsenturk](https://avatars.githubusercontent.com/u/10936547?v=4)](https://github.com/cuneytsenturk "cuneytsenturk (16 commits)")[![ariaieboy](https://avatars.githubusercontent.com/u/15873972?v=4)](https://github.com/ariaieboy "ariaieboy (11 commits)")[![danharrin](https://avatars.githubusercontent.com/u/41773797?v=4)](https://github.com/danharrin "danharrin (8 commits)")[![fridzema](https://avatars.githubusercontent.com/u/8180660?v=4)](https://github.com/fridzema "fridzema (7 commits)")[![ralphjsmit](https://avatars.githubusercontent.com/u/59207045?v=4)](https://github.com/ralphjsmit "ralphjsmit (4 commits)")[![imanghafoori1](https://avatars.githubusercontent.com/u/6961695?v=4)](https://github.com/imanghafoori1 "imanghafoori1 (4 commits)")[![Stichoza](https://avatars.githubusercontent.com/u/1139050?v=4)](https://github.com/Stichoza "Stichoza (2 commits)")[![alliuqemal](https://avatars.githubusercontent.com/u/36800086?v=4)](https://github.com/alliuqemal "alliuqemal (2 commits)")[![aidan-casey](https://avatars.githubusercontent.com/u/6686277?v=4)](https://github.com/aidan-casey "aidan-casey (2 commits)")[![alanbrande](https://avatars.githubusercontent.com/u/16725715?v=4)](https://github.com/alanbrande "alanbrande (2 commits)")[![Luke-Shepp](https://avatars.githubusercontent.com/u/35956374?v=4)](https://github.com/Luke-Shepp "Luke-Shepp (2 commits)")[![thecrazybob](https://avatars.githubusercontent.com/u/20065018?v=4)](https://github.com/thecrazybob "thecrazybob (1 commits)")[![buzzclue](https://avatars.githubusercontent.com/u/43321373?v=4)](https://github.com/buzzclue "buzzclue (1 commits)")[![CihanSenturk](https://avatars.githubusercontent.com/u/53110792?v=4)](https://github.com/CihanSenturk "CihanSenturk (1 commits)")[![dmcbrn](https://avatars.githubusercontent.com/u/40859618?v=4)](https://github.com/dmcbrn "dmcbrn (1 commits)")[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (1 commits)")[![iRaziul](https://avatars.githubusercontent.com/u/51883557?v=4)](https://github.com/iRaziul "iRaziul (1 commits)")[![lguima](https://avatars.githubusercontent.com/u/1562097?v=4)](https://github.com/lguima "lguima (1 commits)")[![mmahdavis](https://avatars.githubusercontent.com/u/13764067?v=4)](https://github.com/mmahdavis "mmahdavis (1 commits)")

---

Tags

akauntingcurrencycurrency-converterlaravelmoneyphplaravelmoneycurrencyconvertformat

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/akaunting-laravel-money/health.svg)

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

###  Alternatives

[cknow/laravel-money

Laravel Money

1.0k4.3M22](/packages/cknow-laravel-money)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)

PHPackages © 2026

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