PHPackages                             wujunze/money-wrapper - 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. wujunze/money-wrapper

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

wujunze/money-wrapper
=====================

MoneyPHP Wrapper

1.0.2(7y ago)103.8k↓80%2MITPHPPHP &gt;=7.1

Since Jul 3Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/526e59aa463c4ec381738dc5b5d18feb6c4e0de15a67961ed16c5e359b348747/68747470733a2f2f7472617669732d63692e6f72672f77756a756e7a652f6d6f6e65792d777261707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wujunze/money-wrapper) [![Latest Stable Version](https://camo.githubusercontent.com/128f783afdd9fd01420c58672cc8bd7a12698de8053e9e40afe390bbbb36ae39/68747470733a2f2f706f7365722e707567782e6f72672f77756a756e7a652f6d6f6e65792d777261707065722f762f737461626c65)](https://packagist.org/packages/wujunze/money-wrapper) [![Total Downloads](https://camo.githubusercontent.com/77ad11661b70ac2720afee61f426b2c49c8ae850970886f72b1c3948351c26d7/68747470733a2f2f706f7365722e707567782e6f72672f77756a756e7a652f6d6f6e65792d777261707065722f646f776e6c6f616473)](https://packagist.org/packages/wujunze/money-wrapper) [![License](https://camo.githubusercontent.com/ef9fdb829b8a61227ebc18c7f250db9c15bd50eeb49437de66ad4451d61d2d75/68747470733a2f2f706f7365722e707567782e6f72672f77756a756e7a652f6d6f6e65792d777261707065722f6c6963656e7365)](https://packagist.org/packages/wujunze/money-wrapper)

MoneyPHP Wrapper
----------------

[](#moneyphp-wrapper)

Base on [money-wrapper](https://github.com/cleaniquecoders/money-wrapper)
-------------------------------------------------------------------------

[](#base-on-money-wrapper)

This is a wrapper for [Money](https://github.com/moneyphp/money).

This wrapper:

1. Provide a Money helper - `money()`
2. Intended for Laravel Framework, but can be use outside from Laravel Framework as well.
3. Provide common usage such as:

- For Human Readability - RM 1.00, RM 345.00
- For Common Display - 1.00, 345.00
- For Machine (intended format to store in Database - integer) - 100, 34500
- Fixed Exchange Rate Conversion - $ 1 &gt; RM 3.87

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

[](#installation)

1. In order to install `wujunze/money-wrapper` in your Laravel project, just run the *composer require* command from your terminal:

```
$ composer require wujunze/money-wrapper

```

2. Then in your `config/app.php` add the following to the providers array:

```
wujunze\MoneyWrapper\MoneyWrapperServiceProvider::class,
```

3. In the same `config/app.php` add the following to the aliases array:

```
'MoneyWrapper' => wujunze\MoneyWrapper\MoneyWrapperFacade::class,
```

4. Publish Money Wrapper Config:

```
$ php artisan vendor:publish --tag=money-wrapper-config

```

> You may want to add more currency details based on country. See contributions section below for the details.

Usage
-----

[](#usage)

**Get Money Wrapper Instance**

By default, MYR, Malaysia Ringgit currency will be use.

You may override either by `.env` file or pass the country Alpha 2 code when calling `money()` helper.

```
$money = money(); // by default it will use MY
$moneyUsd = money('US'); // pass the country code - ISO Alpha 2
```

You can add more currencies after publishing the Money Wrapper configuration file and added more supported currencies.

Please refer to [Country Code](http://www.nationsonline.org/oneworld/country_code_list.htm) and it's currency swift code and symbol in [Currency List](http://www.xe.com/iso4217.php).

**Get Money Format**

```
echo money()->toHuman(100); // RM 1.00, useful for human readability
echo money()->toCommon(100); // 1.00
echo money()->toMachine('1.00'); // 100, always store in database as integer.
```

**Convert Fixed Rate**

```
$fixedExchange = [
    'MYR' => [
        'USD' => 3.87,
    ],
];
echo money()->convertFixedRate($fixedExchange, 100, 'USD')->getAmount(); // 387
```

> Recommended data type used in database is big integer

Contributions
-------------

[](#contributions)

Updating currency list (`config/currency.php`) available based on following resources:

1. Use Country ISO Alpha 2 Code for the Key as defined in [Country List](http://www.nationsonline.org/oneworld/country_code_list.htm).
2. Refer [currency list](http://www.xe.com/iso4217.php) for the available currency.
3. Use symbol as per stated in [www.xe.com](http://www.xe.com/symbols.php).

The structure will be as following:

```
[
	'MYR' => [
		'swift_code' => 'MYR',
		'symbol' => 'RM'
	]
]
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

2918d ago

PHP version history (2 changes)1.0PHP &gt;=7.0

1.0.1PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0bf502ba4ce9952fcb8a819f9aca3fa616e237ad8d59a47b9071710e95422c1d?d=identicon)[wujunze](/maintainers/wujunze)

---

Top Contributors

[![wujunze](https://avatars.githubusercontent.com/u/12997869?v=4)](https://github.com/wujunze "wujunze (3 commits)")

---

Tags

laravel-5-packagemoneyphpphp-libraryphplaravelmoneypackagewrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wujunze-money-wrapper/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.7k](/packages/larastan-larastan)[cknow/laravel-money

Laravel Money

1.0k4.6M29](/packages/cknow-laravel-money)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7212.9k](/packages/tehwave-laravel-achievements)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)

PHPackages © 2026

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