PHPackages                             jesprna/jaysfi-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. jesprna/jaysfi-money

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

jesprna/jaysfi-money
====================

Currency formatting and conversion package for Laravel

v1.0.0(5mo ago)01.2k↓65.6%MITPHPPHP ^8.2

Since Jan 10Pushed 5mo agoCompare

[ Source](https://github.com/jesprna/jaysfi-money)[ Packagist](https://packagist.org/packages/jesprna/jaysfi-money)[ RSS](/packages/jesprna-jaysfi-money/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

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

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

[![Downloads](https://camo.githubusercontent.com/d909e8cec2df60c18c1b76d98116aa017e6e91c76e76f07aff0ab8519c6ba828/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a657370726e612f6a61797366692d6d6f6e6579)](https://camo.githubusercontent.com/d909e8cec2df60c18c1b76d98116aa017e6e91c76e76f07aff0ab8519c6ba828/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a657370726e612f6a61797366692d6d6f6e6579)[![Tests](https://camo.githubusercontent.com/2b7f985ae127cecef16b61c6ff95e26223533b670dd86e082f2396f0d28d5c34/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a657370726e612f6a61797366692d6d6f6e65792f74657374732e796d6c3f6c6162656c3d7465737473)](https://camo.githubusercontent.com/2b7f985ae127cecef16b61c6ff95e26223533b670dd86e082f2396f0d28d5c34/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a657370726e612f6a61797366692d6d6f6e65792f74657374732e796d6c3f6c6162656c3d7465737473)[![StyleCI](https://camo.githubusercontent.com/58789554dbb390b1f3e1230047ab49c0ed3fc4f965d2f365a2ccbfbe428ff5f2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3131323132313530382f736869656c643f7374796c653d666c6174266272616e63683d6d6173746572)](https://styleci.io/repos/112121508)[![License](https://camo.githubusercontent.com/9a42df7de62f477a21a978141c3eadd081f29c2f593c34983a30aa5b38e02f3c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a657370726e612f6a61797366692d6d6f6e6579)](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 jesprna/jaysfi-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 Jesprna\Money\Currency;
use Jesprna\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 Jesprna\Money\Currency;
use Jesprna\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 Jesprna\Money\Currency;
use Jesprna\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 Jesprna\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/jesprna/jaysfi-money/security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jays](https://github.com/jesprna)
- [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

40

—

FairBetter than 86% of packages

Maintenance70

Regular maintenance activity

Popularity19

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.2% 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

168d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/999042c0244396cbd9fbee3654cbc6ab436604538a3b3daac92505b4bfbec06f?d=identicon)[jesprna](/maintainers/jesprna)

---

Top Contributors

[![denisdulici](https://avatars.githubusercontent.com/u/5254835?v=4)](https://github.com/denisdulici "denisdulici (103 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)")[![jesprna](https://avatars.githubusercontent.com/u/48647209?v=4)](https://github.com/jesprna "jesprna (3 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)")[![Stichoza](https://avatars.githubusercontent.com/u/1139050?v=4)](https://github.com/Stichoza "Stichoza (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)")

---

Tags

laravelmoneycurrencyconvertformat

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jesprna-jaysfi-money/health.svg)

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

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7855.7M44](/packages/akaunting-laravel-money)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M120](/packages/laravel-mcp)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8385.5M96](/packages/laravel-doctrine-orm)

PHPackages © 2026

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