PHPackages                             garak/money-bundle - 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. garak/money-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

garak/money-bundle
==================

Bundle to use a single mapped currency with moneyphp/money

v1.5.0(5mo ago)1489LGPL-3.0-or-laterPHPPHP ^8.1CI passing

Since Aug 28Pushed 4mo ago1 watchersCompare

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

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

Money bundle
============

[](#money-bundle)

[![Total Downloads](https://camo.githubusercontent.com/c498af8bf459975820ddaf07c22d99d0f9a311cb361ea2f87d766fa9f1bc1e4c/68747470733a2f2f706f7365722e707567782e6f72672f676172616b2f6d6f6e65792d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/garak/money-bundle)[![Build](https://github.com/garak/money-bundle/actions/workflows/build.yaml/badge.svg)](https://github.com/garak/money-bundle/actions/workflows/build.yaml)[![Maintainability](https://camo.githubusercontent.com/7d3efaf3c231b84709967d195aa1a2fe32d44d9eae6ead9efdb92625b6550ce4/68747470733a2f2f716c74792e73682f67682f676172616b2f70726f6a656374732f6d6f6e65792f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/garak/projects/money)[![Code Coverage](https://camo.githubusercontent.com/24aae0e8de8a314188c004cf45d336c3d49f7f666c93d2997ed96c55de86d3a4/68747470733a2f2f716c74792e73682f67682f676172616b2f70726f6a656374732f6d6f6e65792f636f7665726167652e737667)](https://qlty.sh/gh/garak/projects/money)

The purpose of this bundle is straightforward: using the `moneyphp/money` library with a single currency.

The typical use is when you need to map an amount of money to a database field. You could embed the Money object in your entity, but this is not perfectly working, because Doctrine doesn't support nullable embeddable objects.

Moreover, you probably want to use a single currency in your project, so you don't want to use a useless column for the currency itself.

With this bundle, you can use "money" as a type. It's up to you to choose if your property is nullable or not (as for any other Doctrine mapping, the default option is not nullable). You're done: your property will be mapped to a Money EUR object (see below for customisations).

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

[](#installation)

Execute `composer require garak/money-bundle`.

Mapping example
---------------

[](#mapping-example)

```

```

Form type extension
-------------------

[](#form-type-extension)

This bundle configures a form type extension for the Symfony MoneyType, which does two things:

- set the default option of `divisor` to `100` (which should be the value to use with most currencies)
- cast the submitted value to an integer, which is the format expected by `moneyphp/money`. The submitted value can be cast directly to a `Money` object by configuring the bundle option `money_transform` to true

You don't need to do anything to use this extension, which is automatically applied.

Twig extension
--------------

[](#twig-extension)

This bundle exposes a Twig filter called `money`. It's useful to format the value of your money property.

Example:

```
{# if the value in the database is 5099, this will display "€50,99" #}
{{ foo.payment|money }}
```

If the value is nullable, you can use the `nullable_money` filter instead:

```
{# display "€50,99" for 5099 and nothing for null #}
{{ foo.paymentOrNull|nullable_money }}
```

Customisations
--------------

[](#customisations)

You can use a currency different from EUR. Also, you can customise the separators used by the Twig extension, and have the symbol after the amount (with a space, if you want). Finally, you can enable the transformation of the submitted value to a `Money`object in the form type extension.

Here's an example of a configuration file:

```
money:
  currency: CHF         # default "EUR"
  decimal: "."          # default ","
  thousands: ","        # default "."
  after: true           # default false
  space: true           # default false
  money_transform: true # default false
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance74

Regular maintenance activity

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Recently: every ~80 days

Total

10

Last Release

164d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d191f9ff3aa52357cb523c9eec3553d267128fc75e0faf9dca74f289f6604f54?d=identicon)[garak](/maintainers/garak)

---

Top Contributors

[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (33 commits)")

---

Tags

bundlemoneysymfonysymfony-bundlesymfonymoney

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/garak-money-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[pugx/autocompleter-bundle

Add an autocomplete type to forms

93861.6k3](/packages/pugx-autocompleter-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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