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

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

padam87/money-bundle
====================

Symfony bundle for https://github.com/moneyphp/money

v0.6.0(2mo ago)41.4k3MITPHPPHP ^8.4CI failing

Since Jul 24Pushed 2mo ago1 watchersCompare

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

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

MoneyBundle
===========

[](#moneybundle)

Symfony bundle for

As an **opinionated** bundle, this money bundle uses the following principles as it's main guide:

- Storage is just as important as calculation.
- Financial data should be held in SQL, so Doctrine ORM only implementation.
- Money objects are Embeddables.
- Amount should be stored in a human readable way in the database.
- ISO money scale (eg smallest amount is 1 cent for EUR) is not viable for complex applications.

To achieve these, the following restrictions apply:

- precision and scale are mandatory (but have default values)
- amounts are mapped as DECIMAL (changable, but not recommended to change)
- ext-bcmath is mandatory.

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

[](#installation)

`composer require padam87/money-bundle`

Configuration (optional)
------------------------

[](#configuration-optional)

```
padam87_money:
    precision:            18
    scale:                2
    currencies:

        # Default:
        - EUR
```

Usage
-----

[](#usage)

### Doctrine

[](#doctrine)

#### A) Using the embedded money type

[](#a-using-the-embedded-money-type)

```
    #[ORM\Embedded(class: EmbeddedMoney::class)]
    protected EmbeddedMoney $netPrice;

    public function getNetPrice(): ?Money
    {
        return ($this->netPrice)();
    }

    public function setNetPrice(?Money $netPrice): self
    {
        $this->netPrice = new EmbeddedMoney($netPrice);

        return $this;
    }
```

#### B) Using separate fields for amount and currency

[](#b-using-separate-fields-for-amount-and-currency)

*This is recommended when multiple amounts share the same currency*

```
    use MoneyFromDecimalTrait;

    #[ORM\Column(type: 'currency')]
    private ?Currency $currency = null;

    #[ORM\Column(type: 'decimal_object')]
    private ?BigDecimal $netPrice = null;

    #[ORM\Column(type: 'decimal_object')]
    private ?BigDecimal $grossPrice = null;

    public function getCurrency(): ?Currency
    {
        return $this->currency;
    }

    public function getNetPrice(): Money
    {
        return $this->getMoney($this->netPrice);
    }

    protected function setNetPrice(Money $netPrice): self
    {
        $this->setMoney($this->netPrice, $netPrice);

        return $this;
    }

    public function getGrossPrice(): Money
    {
        return $this->getMoney($this->grossPrice);
    }

    protected function setGrossPrice(Money $grossPrice): self
    {
        $this->setMoney($this->grossPrice, $grossPrice);

        return $this;
    }
```

### Formatting

[](#formatting)

#### Twig

[](#twig)

`{{ netPrice|money }}` -&gt; €100

`{{ netPrice|money_amount }}` -&gt; 100

`{{ netPrice|money_currency }}` -&gt; €

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity77

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

Recently: every ~534 days

Total

12

Last Release

60d ago

PHP version history (3 changes)v0.1.0PHP ^7.0

v0.5.0PHP ^7.4 || ^8.0

v0.6.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/16ee53cf1050ad8f7ac884365abee80ded7fc531a57cadbdaef303de59e69222?d=identicon)[Padam87](/maintainers/Padam87)

---

Top Contributors

[![Padam87](https://avatars.githubusercontent.com/u/776488?v=4)](https://github.com/Padam87 "Padam87 (58 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

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

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

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

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

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[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)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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