PHPackages                             onmoon/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. [Database &amp; ORM](/categories/database)
4. /
5. onmoon/money

ActiveLibrary[Database &amp; ORM](/categories/database)

onmoon/money
============

Opinionated extension of moneyphp/money with Doctrine types

2.0.0(1y ago)13.9k1[1 issues](https://github.com/onmoon/money/issues)[1 PRs](https://github.com/onmoon/money/pulls)MITPHPPHP ^8.1CI failing

Since Feb 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/onmoon/money)[ Packagist](https://packagist.org/packages/onmoon/money)[ RSS](/packages/onmoon-money/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (10)Versions (10)Used By (0)

OnMoon Money
============

[](#onmoon-money)

[![Latest Version](https://camo.githubusercontent.com/9f11e791c8a6a23cd2fa11af47ea3c357ebde8a2183300556f4bf47d00b910b3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6f6e6d6f6f6e2f6d6f6e6579)](https://github.com/onmoon/money/releases)[![Build](https://github.com/onmoon/money/actions/workflows/ci.yml/badge.svg)](https://github.com/onmoon/money/actions)[![License](https://camo.githubusercontent.com/4f70b918c0bdf34f9397fa4dba196d4ec7b40e5dcb881b77c1d193a09ced23e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f6e6d6f6f6e2f6d6f6e6579)](https://github.com/onmoon/money/blob/master/LICENSE)[![Email](https://camo.githubusercontent.com/edd4eec5a4505282adad0f59e8d23d8956e2d0647b6dae5290f3b63d2ef381b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f656d61696c2d7066406373676f2e636f6d2d626c75652e7376673f7374796c653d666c61742d737175617265)](mailto:pf@csgo.com)

OnMoon Money is an opinionated wrapper around MoneyPHP Money:

- [Installation](#installation)
- [Features](#features)
- [Usage](#usage)
    - [Currency classes](#currency-classes)
    - [Money classes](#money-classes)
        - [Subunits](#subunits)
        - [Validation](#validation)
    - [Error handling](#error-handling)
    - [Using the library with Symfony and Doctrine](#using-the-library-with-symfony-and-doctrine)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

```
composer require onmoon/money

```

Features
--------

[](#features)

On top of the wonderful API of the original, more strictness and some additional features are added.

**Money classes can be extended and used as Doctrine Embeddables**

The MoneyPHP objects are final, so you can't create your own domain value objects adding more semantics to the code:

```
