This package is abandoned and no longer maintained. The author suggests using the mohamedhekal/ledgercore package instead.

Double-entry ledger engine for Laravel ERP/fintech: balanced journals, immutable postings, balances, and period locks

Maintainers

Package info

github.com/mohamedhekal/ledgercore

pkg:composer/mohamedmohamedhekal/ledgercore

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-07-16 14:23 UTC

This package is auto-updated.

Last update: 2026-07-16 14:40:22 UTC


README

CI License: MIT PHP Laravel

Search terms: laravel, accounting, ledger, double-entry, journal, erp, fintech, php, laravel-package, bookkeeping, general-ledger, accounting-engine.

Double-entry ledger engine for Laravel ERP/fintech apps: balanced journals, immutable postings, account balances, and fiscal period locks.

Amounts are integer minor units (cents). Single currency in v0.1.

Installation

composer require mohamedhekal/ledgercore
php artisan vendor:publish --tag=ledgercore-config
php artisan migrate

Chart + period

use Hekal\LedgerCore\Models\Account;
use Hekal\LedgerCore\Models\FiscalPeriod;
use Hekal\LedgerCore\Enums\AccountType;

FiscalPeriod::create([
    'name' => '2026',
    'starts_on' => '2026-01-01',
    'ends_on' => '2026-12-31',
]);

$cash = Account::create(['code' => '1000', 'name' => 'Cash', 'type' => AccountType::Asset]);
$sales = Account::create(['code' => '4000', 'name' => 'Sales', 'type' => AccountType::Revenue]);

Post a journal

use Hekal\LedgerCore\Facades\Ledger;
use Hekal\LedgerCore\Support\JournalLineDraft;

$journal = Ledger::post('2026-03-15', [
    new JournalLineDraft($cash->id, debit: 10_000),
    new JournalLineDraft($sales->id, credit: 10_000),
], memo: 'Cash sale');

Ledger::reverse($journal);
$tb = Ledger::trialBalance(); // totals.balanced === true

Guarantees

  • Unbalanced journals throw
  • Lines must be debit XOR credit
  • Closed periods reject posts
  • Postings are append-only; corrections use reversing journals
  • Account rows are lockForUpdate during post

Limitations (v0.1)

  • No multi-currency / FX
  • No cost-center dimensions
  • No inventory valuation (see StockPulse)
  • Trial balance lists raw debit/credit totals, not presentation-side nets

Testing

composer install && composer test

License

MIT