PHPackages                             centrex/laravel-accounting - 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. centrex/laravel-accounting

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

centrex/laravel-accounting
==========================

Manage accounts in laravel

v1.5.5(4mo ago)02.5kMITPHPPHP ^8.2|^8.3|^8.4CI failing

Since Nov 13Pushed 1mo agoCompare

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

READMEChangelogDependencies (15)Versions (29)Used By (0)

Laravel Accounting
==================

[](#laravel-accounting)

[![Latest Version on Packagist](https://camo.githubusercontent.com/097bbcce3b9da96e4b5028f964a03a27e07c3bc93cd2511bd21072c5a215265b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63656e747265782f6c61726176656c2d6163636f756e74696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/centrex/laravel-accounting)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f20b61eb44068cf9ed37111fb4210058ff46d8caf9d7473a8367e7ae2a61bbbe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63656e747265782f6c61726176656c2d6163636f756e74696e672f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/centrex/laravel-accounting/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/52902a7f2f96dbe4d8084fb5ee149e30fdf91eebe6d6974eafb43436d73d1e09/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63656e747265782f6c61726176656c2d6163636f756e74696e672f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/centrex/laravel-accounting/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/93e572b3693c8385f9308b4e682b9c56e02c8e03f0d771faf6adf8585cb0e757/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63656e747265782f6c61726176656c2d6163636f756e74696e673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/centrex/laravel-accounting)

Full double-entry accounting system for Laravel. Includes a chart of accounts, journal entries, invoices, bills, customer/vendor management, financial reports, and a Livewire UI — all with a REST API layer.

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

[](#installation)

```
composer require centrex/laravel-accounting
php artisan vendor:publish --tag="accounting-config"
php artisan migrate
```

Seed the standard chart of accounts (idempotent):

```
use Centrex\LaravelAccounting\Facades\Accounting;

Accounting::initializeChartOfAccounts();
```

Environment variables
---------------------

[](#environment-variables)

```
ACCOUNTING_CURRENCY=BDT
ACCOUNTING_DB_CONNECTION=mysql        # optional separate connection
ACCOUNTING_TABLE_PREFIX=acct_
ACCOUNTING_FISCAL_START_MONTH=1
ACCOUNTING_FISCAL_AUTO_CREATE=true
```

Core concepts
-------------

[](#core-concepts)

- **Double-entry**: every `JournalEntry` has debit and credit lines that must balance before posting.
- **Account types**: `asset | liability | equity | revenue | expense` — assets/expenses have debit-normal balances.
- **Entry statuses**: `draft → posted → void` — only `posted` lines affect balances and reports.
- **Invoice/Bill statuses**: `draft → sent → partial → paid`.

Usage
-----

[](#usage)

### Journal entries

[](#journal-entries)

```
use Centrex\LaravelAccounting\Facades\Accounting;

$entry = Accounting::createJournalEntry([
    'date'        => today(),
    'reference'   => 'REF-001',
    'type'        => 'general',   // general | closing | adjustment
    'description' => 'Office rent',
    'currency'    => 'BDT',
    'lines' => [
        ['account_id' => $rentId, 'type' => 'debit',  'amount' => 50000],
        ['account_id' => $cashId, 'type' => 'credit', 'amount' => 50000],
    ],
]);

$entry->post();          // validates balance, records approved_by/approved_at
$entry->void();          // only callable on posted entries
$entry->isBalanced();    // bool
```

### Invoices

[](#invoices)

```
use Centrex\LaravelAccounting\Models\{Customer, Invoice};

$customer = Customer::create(['name' => 'Acme Corp', 'email' => 'acme@example.com']);

$invoice = Invoice::create([
    'customer_id'  => $customer->id,
    'invoice_date' => today(),
    'due_date'     => today()->addDays(30),
    'subtotal'     => 10000,
    'tax_amount'   => 1500,
    'total'        => 11500,
    'currency'     => 'BDT',
]);

// Post → creates JE: DR Accounts Receivable / CR Sales Revenue + Tax
Accounting::postInvoice($invoice);
// Fires: InvoicePosted → SyncCustomerOutstanding

// Record payment → creates JE: DR Cash / CR Accounts Receivable
Accounting::recordInvoicePayment($invoice, [
    'date'   => today(),
    'amount' => 11500,
    'method' => 'bank_transfer',   // cash | bank_transfer | cheque | card | mobile_banking
]);
// Fires: PaymentRecorded → NotifyAccountingTeam
// Invoice status auto-updates: partial if part-paid, paid if fully paid
```

### Bills

[](#bills)

```
use Centrex\LaravelAccounting\Models\{Vendor, Bill};

$vendor = Vendor::create(['name' => 'Supplier Ltd', 'email' => 'supplier@example.com']);

$bill = Bill::create([
    'vendor_id' => $vendor->id,
    'bill_date' => today(),
    'due_date'  => today()->addDays(30),
    'subtotal'  => 8000,
    'tax_amount'=> 1200,
    'total'     => 9200,
]);

// Post → creates JE: DR Expense + Tax / CR Accounts Payable
Accounting::postBill($bill);

Accounting::recordBillPayment($bill, ['date' => today(), 'amount' => 9200, 'method' => 'bank_transfer']);
```

### Financial reports

[](#financial-reports)

```
// Trial Balance
$tb = Accounting::getTrialBalance('2025-01-01', '2025-12-31');
// ['accounts' => [...], 'total_debits' => x, 'total_credits' => x, 'is_balanced' => bool]

// Balance Sheet
$bs = Accounting::getBalanceSheet(now());
// ['assets' => [...], 'liabilities' => [...], 'equity' => [...], 'is_balanced' => bool]

// Income Statement (P&L)
$pl = Accounting::getIncomeStatement('2025-01-01', '2025-12-31');
// ['revenue' => [...], 'expenses' => [...], 'gross_profit' => x, 'net_income' => x]

// Cash Flow Statement
$cf = Accounting::getCashFlowStatement('2025-01-01', '2025-12-31');
// ['operating_activities' => x, 'investing_activities' => x, 'financing_activities' => x, 'net_change' => x]
```

### Fiscal year closing

[](#fiscal-year-closing)

```
use Centrex\LaravelAccounting\Models\FiscalYear;

$fy = FiscalYear::where('name', '2025')->first();
Accounting::closeFiscalYear($fy);
// Transfers net income → Retained Earnings (3100) via closing JE, marks $fy->is_closed = true
```

Web UI
------

[](#web-ui)

All routes are protected by `web_middleware` (default `['web', 'auth']`) under the `web_prefix` (default `accounting`):

RouteURLDescription`accounting.dashboard``/accounting/dashboard`Overview dashboard`accounting.accounts``/accounting/accounts`Chart of accounts`accounting.journal``/accounting/journal-entries`Journal entries`accounting.invoices``/accounting/invoices`Invoice management`accounting.bills``/accounting/bills`Bill management`accounting.customers``/accounting/customers`Customer list`accounting.vendors``/accounting/vendors`Vendor list`accounting.reports``/accounting/reports`Financial reportsREST API
--------

[](#rest-api)

Base prefix: `api/accounting`. Default middleware: `['api', 'auth:sanctum']`.

MethodEndpointActionGET/POST`/api/accounting/accounts`list / createGET`/api/accounting/accounts/{id}/balance`current balancePOST`/api/accounting/journal-entries`createPOST`/api/accounting/journal-entries/{id}/post`postPOST`/api/accounting/journal-entries/{id}/void`voidGET/POST`/api/accounting/invoices`list / createPOST`/api/accounting/invoices/{id}/post`postPOST`/api/accounting/invoices/{id}/payments`record paymentGET/POST`/api/accounting/bills`list / createPOST`/api/accounting/bills/{id}/post`postPOST`/api/accounting/bills/{id}/payments`record paymentGET`/api/accounting/reports/trial-balance`trial balanceGET`/api/accounting/reports/balance-sheet`balance sheetGET`/api/accounting/reports/income-statement`P&amp;LGET`/api/accounting/reports/cash-flow`cash flowTesting
-------

[](#testing)

```
composer test        # full suite
composer test:unit   # pest only
composer test:types  # phpstan
composer lint        # pint
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [centrex](https://github.com/centrex)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance85

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 92.2% 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 ~32 days

Recently: every ~0 days

Total

25

Last Release

142d ago

Major Versions

v0.1.0 → v1.0.02023-12-14

PHP version history (4 changes)v0.1.0PHP ^8.0|^8.1

v1.0.1PHP ^8.1|^8.2

v1.3.0PHP ^8.1|^8.2|^8.3

v1.5.0PHP ^8.2|^8.3|^8.4

### Community

Maintainers

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

---

Top Contributors

[![rochi88](https://avatars.githubusercontent.com/u/29769944?v=4)](https://github.com/rochi88 "rochi88 (95 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![kolazsys](https://avatars.githubusercontent.com/u/110965082?v=4)](https://github.com/kolazsys "kolazsys (1 commits)")

---

Tags

laravellaravel-accountingcentrex

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/centrex-laravel-accounting/health.svg)

```
[![Health](https://phpackages.com/badges/centrex-laravel-accounting/health.svg)](https://phpackages.com/packages/centrex-laravel-accounting)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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