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

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

headsnet/money-bundle
=====================

Integrates moneyphp/money into your Symfony application

v0.2.0(1y ago)1116.2k—0%MITPHPPHP &gt;=8.1

Since Mar 12Pushed 1y ago2 watchersCompare

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

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

[![Build Status](https://github.com/headsnet/money-bundle/actions/workflows/ci.yaml/badge.svg)](https://github.com/headsnet/money-bundle/actions/workflows/ci.yaml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/68ff481e9e9b91cd845d9a3f21ef8cade773aee9cd03b2d666e016ff48360c01/68747470733a2f2f706f7365722e707567782e6f72672f68656164736e65742f6d6f6e65792d62756e646c652f76)](//packagist.org/packages/headsnet/money-bundle)[![Total Downloads](https://camo.githubusercontent.com/97fac6b40142fbd59931bbde02f7ac39fcdf96af0e2556d522ef14a7f5cded1e/68747470733a2f2f706f7365722e707567782e6f72672f68656164736e65742f6d6f6e65792d62756e646c652f646f776e6c6f616473)](//packagist.org/packages/headsnet/money-bundle)[![License](https://camo.githubusercontent.com/9654c95e738b29d236e44b0017cd7a3f747b20c0bf0d1be29d1fa691acc84df6/68747470733a2f2f706f7365722e707567782e6f72672f68656164736e65742f6d6f6e65792d62756e646c652f6c6963656e7365)](//packagist.org/packages/headsnet/money-bundle)

Money Bundle
============

[](#money-bundle)

A Symfony bundle to integrate [Money PHP](https://github.com/moneyphp/money) into your application.

Summary Of Features
-------------------

[](#summary-of-features)

- **Twig Extensions** - display and manipulate Money objects in Twig templates
- **Doctrine Support** - persist Money objects in your storage layer
- **Custom Serializer** - serialize Money objects to and from string or array values
- **Custom Form Type** - use Money objects in form data classes

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

[](#installation)

Simply install with Composer in the usual way.

```
composer require headsnet/money-bundle
```

Then add to your `bundles.php` file.

```
Headsnet\MoneyBundle\HeadsnetMoneyBundle::class => ['all' => true]
```

Doctrine
--------

[](#doctrine)

The bundle provides a custom Doctrine Type for the `Currency` element of the Money object, and then a Doctrine Embeddable for use in your models.

The data type for the `amount` column is set to `integer` which is evidently a contentious issue as the Money object uses strings internally, but having the database use an integer type allows native sorting and summing etc.

Forms
-----

[](#forms)

The bundle provides a form type with a Data Transformer, that extends the Symfony `MoneyType`.

The field will render a Money field, with the Money value object converted to readable values.

Twig
----

[](#twig)

### Formatters

[](#formatters)

The bundle provides a Twig filter which formats a Money object in to a number with a currency symbol.

```
{{ object.amount|money }}        # Renders e.g. "€10.00"
```

### Manipulation

[](#manipulation)

The bundle also provides a Twig utility that allows you to create a Money object directly in the template.

```
money(AMOUNT, 'CURRENCY_CODE')
```

This is generally useful for creating a variable which you then add values to in a loop. E.g.

```
{% set total = money(0, 'EUR') %}

{% for line in order.lines %}

	{% set total = total.add(line.cost) %}

{% endfor %}

Total: {{ total|money }}
```

Serializer
----------

[](#serializer)

The bundle provides a Symfony normalizer for the Money object.

```
$amount = Money::EUR(200);

$serializer->serialize($amount, 'json'); // ==> '{"amount":"200","currency":"EUR"}'
```

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

[](#contributing)

Contributions are welcome. Please submit pull requests with one fix/feature per pull request.

Composer scripts are configured for your convenience:

```
> composer cs         # Run coding standards checks
> composer cs-fix     # Fix coding standards violations

```

### Licence

[](#licence)

This code is released under the MIT licence. Please see the LICENSE file for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

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

Total

15

Last Release

519d ago

PHP version history (3 changes)v0.0.1PHP &gt;=7.2

v0.1.5PHP &gt;=7.4

v0.2.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![benr77](https://avatars.githubusercontent.com/u/2156742?v=4)](https://github.com/benr77 "benr77 (46 commits)")

---

Tags

symfonybundlemoneymoneyphpmoney pattern

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)[kucharovic/money-bundle

This bundle provides integration for Money library in your Symfony project.

2253.7k](/packages/kucharovic-money-bundle)[ekreative/uuid-extra-bundle

Paramconverter, Normalizer and Form Type for Ramsey Uuid

18168.6k](/packages/ekreative-uuid-extra-bundle)[fsi/datagrid-bundle

FSi Datagrid Bundle

1859.8k1](/packages/fsi-datagrid-bundle)[glooby/task-bundle

Scheduling of tasks for symfony made simple

3216.3k](/packages/glooby-task-bundle)

PHPackages © 2026

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