PHPackages                             whilesmart/eloquent-transactions - 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. whilesmart/eloquent-transactions

ActiveLibrary

whilesmart/eloquent-transactions
================================

Account transactions (deposits, withdrawals, transfers, fees, adjustments) recorded against an account for Laravel applications, scoped per owner.

1.0.0(2d ago)00MITPHPPHP ^8.2CI passing

Since Aug 15Pushed todayCompare

[ Source](https://github.com/whilesmartphp/eloquent-transactions)[ Packagist](https://packagist.org/packages/whilesmart/eloquent-transactions)[ RSS](/packages/whilesmart-eloquent-transactions/feed)WikiDiscussions dev Synced today

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

eloquent-transactions
=====================

[](#eloquent-transactions)

Account transactions for Laravel: deposits, withdrawals, transfers, fees, and adjustments recorded against an account and scoped per owner. It is the primitive for bare money movements that are not invoice payments or categorized expenses.

This is a movement primitive, not an accounting model. How balances are derived and whether the system is single- or double-entry is decided by the accounts/ledger layer that composes it; the same transactions can feed either.

Install
-------

[](#install)

```
composer require whilesmart/eloquent-transactions
```

Migrations register automatically. Publish them to customize:

```
php artisan vendor:publish --tag=transactions-migrations
php artisan vendor:publish --tag=transactions-config
```

Model
-----

[](#model)

A `Transaction` belongs to a polymorphic `owner` and targets a polymorphic `account`. Each carries a `type`, a `direction` (credit adds, debit subtracts), a positive `amount_cents`, and a `status`. Only `posted` transactions should count toward a balance.

- `type`: `deposit`, `withdrawal`, `transfer`, `fee`, `adjustment`
- `direction`: `credit`, `debit` (defaulted from the type when omitted)
- `status`: `pending`, `posted`, `void`
- `signedAmountCents()`: the amount signed by direction

Add `Whilesmart\Transactions\Traits\HasTransactions` to an owner model for a `transactions()` relation.

Endpoints
---------

[](#endpoints)

MethodPathPurposeGET`/api/transactions`List, filterable by owner, account, type, status, date range, and `q`POST`/api/transactions`Record a deposit, withdrawal, fee, or adjustmentGET`/api/transactions/{transaction}`ShowPUT`/api/transactions/{transaction}`Edit memo, counterparty, date, status, metadataDELETE`/api/transactions/{transaction}`Soft deletePOST`/api/transactions/transfer`Move funds between two accounts as two matched legsPOST`/api/transactions/{transaction}/void`Void a transaction (a transfer voids both legs)Authorization
-------------

[](#authorization)

Every request is scoped through `whilesmart/eloquent-owner-access`. The host binds an `OwnerAuthorizer`; the package never references an application user model.

Feeding account balances
------------------------

[](#feeding-account-balances)

When a transaction is written, `TransactionRecorded` fires with the transaction. Bridge it in the host to refresh the affected account (and, for a transfer, the counter account). `whilesmart/eloquent-accounts` sums posted transaction credits and debits into its computed balance.

Testing
-------

[](#testing)

```
composer test
composer pint:test
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

2d ago

### Community

Maintainers

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

---

Top Contributors

[![nfebe](https://avatars.githubusercontent.com/u/14317775?v=4)](https://github.com/nfebe "nfebe (2 commits)")

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/whilesmart-eloquent-transactions/health.svg)

```
[![Health](https://phpackages.com/badges/whilesmart-eloquent-transactions/health.svg)](https://phpackages.com/packages/whilesmart-eloquent-transactions)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)

PHPackages © 2026

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