PHPackages                             mattoid/flarum-ext-money-history - 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. mattoid/flarum-ext-money-history

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

mattoid/flarum-ext-money-history
================================

Allow users to track any changes made to their money

v1.1.3.2(10mo ago)51.7k62LPL-1.02PHPCI passing

Since Dec 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Mattoids/flarum-ext-money-history)[ Packagist](https://packagist.org/packages/mattoid/flarum-ext-money-history)[ RSS](/packages/mattoid-flarum-ext-money-history/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (3)Versions (17)Used By (2)

Money History 资金记录
==================

[](#money-history-资金记录)

[![License](https://camo.githubusercontent.com/d3c6040d6f4201a9703d49104f72adfcb27dadf4c178c79993ce28a912e38fd3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4d6174746f6964732f666c6172756d2d6578742d6d6f6e65792d686973746f7279)](https://camo.githubusercontent.com/d3c6040d6f4201a9703d49104f72adfcb27dadf4c178c79993ce28a912e38fd3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4d6174746f6964732f666c6172756d2d6578742d6d6f6e65792d686973746f7279) [![Latest Stable Version](https://camo.githubusercontent.com/286167825536fa183896433ec63721e0c87a78b08cb242e6bb1f85714a6d95a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6174746f69642f666c6172756d2d6578742d6d6f6e65792d686973746f72792e737667)](https://packagist.org/packages/mattoid/flarum-ext-money-history) [![Total Downloads](https://camo.githubusercontent.com/3a93db487a65467da85a4e29dabd3486a26e4732c6fe64832d5f5d711d06672f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6174746f69642f666c6172756d2d6578742d6d6f6e65792d686973746f72792e737667)](https://packagist.org/packages/mattoid/flarum-ext-money-history)

A [Flarum](http://flarum.org) extension to record income and expenses of the users' money, allowing users to track any changes made to their money.

一个 [Flarum](http://flarum.org) 扩展， 用于记录用户的资金进出，以便于用户查看自己的资金流向信息。

#### Please note: This extension does not automatically record transactions. Other extensions need to actively notify this extension of transaction events to record them. Before other extensions are adapted to work with this extension, you can use [Money History Auto](https://github.com/Mattoids/flarum-ext-money-history-auto) extension for automatic recording.

[](#please-note-this-extension-does-not-automatically-record-transactions-other-extensions-need-to-actively-notify-this-extension-of-transaction-events-to-record-them-before-other-extensions-are-adapted-to-work-with-this-extension-you-can-use-money-history-auto-extension-for-automatic-recording)

#### 注意：该插件不会自动记录，需要插件主动通知本插件的记录事件来完成消费。在其他插件为适配本插件之前，可以使用 [Money History Auto](https://github.com/Mattoids/flarum-ext-money-history-auto) 插件来实现自动记录功能。

[](#注意该插件不会自动记录需要插件主动通知本插件的记录事件来完成消费在其他插件为适配本插件之前可以使用-money-history-auto-插件来实现自动记录功能)

Problem
-------

[](#problem)

This extension has been developed and tested only on Chinese forums and did not take into account that there will be multiple languages on the forums at the same time. Therefore, there may be problems when being used on multilingual forums. PRs are welcomed!😊

本插件仅在中文论坛上进行开发与测试，并未考虑到在论坛上同时存在多种语言的情况，因此在多语言论坛上可能存在问题。欢迎PR！😊

Screenshots
-----------

[](#screenshots)

[![YC3SWVB3DL$YERVVRTFOIQ1](https://private-user-images.githubusercontent.com/23447157/309852664-6132bc75-f33f-4818-8c19-e413834dde1f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODIzNTQyNDIsIm5iZiI6MTc4MjM1Mzk0MiwicGF0aCI6Ii8yMzQ0NzE1Ny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.githubusercontent.com/23447157/309852688-d7ce3ad7-7912-4a2f-af4e-8b24219ba5fc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODIzNTQyNDIsIm5iZiI6MTc4MjM1Mzk0MiwicGF0aCI6Ii8yMzQ0NzE1Ny8zMDk4NTI2ODgtZDdjZTNhZDctNzkxMi00YTJmLWFmNGUtOGIyNDIxOWJhNWZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjI1VDAyMTkwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxNGQzODBkZDk4Zjc5Mjc5Y2YxNDBlNjk5M2FhYzkwYjc1Zjc3NmM0Y2RhMmQ5ODIyMWE4NzI2OTAwNmQ2OGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.ez9OqY65epj8b_AbCoKzVrxOKS0fG3S1yhFhSAKKU9s)

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

[](#installation)

Install with composer:

```
composer require mattoid/flarum-ext-money-history:"*"
```

Updating
--------

[](#updating)

```
composer update mattoid/flarum-ext-money-history:"*"
php flarum migrate
php flarum cache:clear
```

How It Works
------------

[](#how-it-works)

`money-history` is no longer meant to be the primary balance-changing entry point.

For new integrations:

1. Other extensions should call the services provided by `antoinefr/flarum-ext-money`.
2. `money` writes history through the `BalanceHistoryRecorder` contract when `mattoid-money-history` is enabled.
3. `money-history` provides the `BalanceHistoryRecorder` implementation and persists the history rows.

This keeps balance mutation and history recording aligned.

Recommended Integration For Other Extensions
--------------------------------------------

[](#recommended-integration-for-other-extensions)

If your extension needs to change user balance, inject:

```
use AntoineFr\Money\Service\BalanceManager;
```

Then use one of these methods:

- `adjustBalance()` for one user
- `adjustBalances()` for bulk updates
- `transferBalance()` for user-to-user transfers
- `syncPersistedBalanceChange()` only when your extension already changed and saved the balance itself inside its own transaction

Example:

```
$this->balances->adjustBalance(
    $user,
    -12.5,
    'MYEXTENSION',
    'vendor-my-extension.forum.history.purchase',
    [
        'itemTitle' => 'VIP Badge',
        'itemTypeKey' => 'vendor-my-extension.forum.item-type.badge',
    ],
    $actor
);
```

Important Notes For Integrators
-------------------------------

[](#important-notes-for-integrators)

- New integrations should not depend on `money-history-auto`.
- If you already persist balance manually in the same transaction as other domain writes, call `syncPersistedBalanceChange()` after the save, with `balanceBefore` and `balanceAfter` context handled by the money service call.
- Keep `sourceParams` flat. Do not store nested JSON objects.
- Use stable translation keys in `source_key`.
- Use `source` as a stable machine-readable source name, for example `MONEYREWARDS` or `DECORATIONSTORE`.

`source_key` And `source_params`
--------------------------------

[](#source_key-and-source_params)

History reasons are rendered on the forum from:

- `source_key`
- `source_params`

The backend should store translation keys and raw parameters, not ready-to-display text.

Recommended conventions:

- plain values: `postNumber`, `itemTitle`, `username`, `orderId`
- translated values: keys ending with `Key`, for example `purchaseTypeKey`
- clickable links: keys ending with `LinkHref`, for example `postLinkHref`, `userLinkHref`

Example:

```
[
    'itemTitle' => 'VIP Badge',
    'purchaseTypeKey' => 'vendor-my-extension.forum.purchase-type.monthly',
    'postLinkHref' => '/d/12/34',
]
```

Then the frontend translation may use:

```
vendor-my-extension:
  forum:
    history:
      purchase: 'Purchased {itemTitle} ({purchaseType})'
```

Performance Notes
-----------------

[](#performance-notes)

- `money-history` itself only writes history records when invoked by the money extension recorder integration.
- Avoid custom per-row history writes when a batch operation can use `adjustBalances()`.
- Avoid fetching extra models just to render history reasons. Put the needed flat values in `source_params`.

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/mattoid/flarum-ext-money-history)
- [GitHub](https://github.com/mattoid/flarum-ext-money-history)
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance75

Regular maintenance activity

Popularity25

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~134 days

Total

16

Last Release

306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e4fda7a9900cbfbd6b1778d8c872b9e4d07d75bad09dd1254c1dac8d79a8c33?d=identicon)[mattoid](/maintainers/mattoid)

---

Top Contributors

[![liufei-ereach](https://avatars.githubusercontent.com/u/179955237?v=4)](https://github.com/liufei-ereach "liufei-ereach (36 commits)")[![huoxin233](https://avatars.githubusercontent.com/u/23447157?v=4)](https://github.com/huoxin233 "huoxin233 (34 commits)")[![Mattoids](https://avatars.githubusercontent.com/u/16252517?v=4)](https://github.com/Mattoids "Mattoids (4 commits)")

---

Tags

flarum

### Embed Badge

![Health badge](/badges/mattoid-flarum-ext-money-history/health.svg)

```
[![Health](https://phpackages.com/badges/mattoid-flarum-ext-money-history/health.svg)](https://phpackages.com/packages/mattoid-flarum-ext-money-history)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12127.5k](/packages/flarum-lang-russian)[fof/byobu

Well integrated, advanced private discussions.

59112.4k11](/packages/fof-byobu)[fof/gamification

Upvotes and downvotes for your Flarum community

4062.0k7](/packages/fof-gamification)[fof/polls

 A Flarum extension that adds polls to your discussions

25130.2k9](/packages/fof-polls)[fof/user-bio

Add a user bio to user profiles

20102.0k9](/packages/fof-user-bio)[fof/sitemap

Generate a sitemap

1796.4k2](/packages/fof-sitemap)

PHPackages © 2026

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