PHPackages                             alimarchal/laravel-chart-of-accounts - 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. alimarchal/laravel-chart-of-accounts

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

alimarchal/laravel-chart-of-accounts
====================================

A comprehensive Chart of Accounts and Accounting module for Laravel — supports Inertia/React and Blade/Livewire frontends, double-entry journal entries, multi-currency, financial reports, bank reconciliation, and more.

v1.4.0(1mo ago)012↓90%MITPHPPHP ^8.2

Since Jun 3Pushed 1mo agoCompare

[ Source](https://github.com/alimarchal/laravel-chart-of-accounts-package)[ Packagist](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)[ Docs](https://github.com/alimarchal/laravel-chart-of-accounts-package)[ RSS](/packages/alimarchal-laravel-chart-of-accounts/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (20)Versions (14)Used By (0)

Laravel Chart of Accounts
=========================

[](#laravel-chart-of-accounts)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b61eb0ac7bb3bf1bfd7bc4a000dfc6e4fd4bb1e06afa3e55f0df861698ae15fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c696d61726368616c2f6c61726176656c2d63686172742d6f662d6163636f756e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)[![Total Downloads](https://camo.githubusercontent.com/484c8d3234e231d16fed12430dd7cefa9d04b7e3230ebd6a2e4dc56c1fb5fd4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c696d61726368616c2f6c61726176656c2d63686172742d6f662d6163636f756e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)[![License](https://camo.githubusercontent.com/b4f9e84534bfad80efe1cf28207f3dc1e19ad5956be9c3effe35cecc9ddddbd1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616c696d61726368616c2f6c61726176656c2d63686172742d6f662d6163636f756e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)[![PHP Version](https://camo.githubusercontent.com/9b2e60dc78b5cf07e0f6f95322cded24e597be0e65b353eed0cc97063393886b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f616c696d61726368616c2f6c61726176656c2d63686172742d6f662d6163636f756e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)

> **Professional-grade, production-ready Chart of Accounts and double-entry Accounting module for Laravel.**One-command install. Works with Jetstream (Blade/Livewire) and Breeze (Inertia/React).
>
> **Author:** Ali Raza Marchal — **Package:** [alimarchal/laravel-chart-of-accounts](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)**Source:** [github.com/alimarchal/laravel-chart-of-accounts-package](https://github.com/alimarchal/laravel-chart-of-accounts-package)

---

Quality Score: 9.2 / 10
-----------------------

[](#quality-score-92--10)

DimensionScoreNotes**Architecture**9.5/10Clean service-layer, Actions pattern, no God classes**Double-Entry Correctness**10/10Balance enforced at DB and application layer + UI**API Coverage**9/10Full versioned REST API with Eloquent resources**Frontend Flexibility**10/10Dual-stack: one env switch (`ACCOUNTING_UI_DRIVER`)**Reporting Depth**9/1010 financial reports covering all standard statements**Security**9/10Spatie Permission RBAC, route middleware, `@can` guards**Developer Experience**9.5/10One-command install, `JournalEntry::record()` helper, Select2 UI**Test Coverage**8/10Feature tests for posting, reversals, voids, edge cases**Documentation**9.5/10Full README, CHANGELOG, PHPDoc, API examples---

Requirements
------------

[](#requirements)

- PHP ^8.2
- Laravel ^10.0 | ^11.0 | ^12.0 | ^13.0

---

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

[](#installation)

```
composer require alimarchal/laravel-chart-of-accounts
```

> **Blade/Livewire apps** (Jetstream): add `ACCOUNTING_UI_DRIVER=blade` to `.env` **before** installing. **Inertia/React apps** (Breeze): leave default (`inertia`).

```
php artisan accounting:install
```

**`accounting:install` does automatically (11 steps):**

1. Publishes accounting migrations
2. Publishes accounting config (`config/accounting.php`)
3. Publishes Blade views (`resources/views/vendor/accounting/`)
4. Publishes public assets — jQuery 3.5.1 + Select2 4.1.0 → `public/vendor/accounting/`
5. Publishes `spatie/laravel-permission` migrations (if not present)
6. Publishes `spatie/laravel-activitylog` migrations (if not present)
7. Runs `php artisan migrate`
8. Seeds all master data (account types, currencies, COA, permissions, tax codes, periods)
9. Syncs database objects (stored procedures, views, triggers)
10. Assigns `super-admin` role to first user
11. Verifies the installation

**After install — add `HasRoles` to your User model:**

```
use Spatie\Permission\Traits\HasRoles;

class User extends Authenticatable
{
    use HasRoles;
}
```

Available roles: `super-admin` (all), `admin`, `accountant`, `viewer`.

---

Upgrading
---------

[](#upgrading)

After `composer update alimarchal/laravel-chart-of-accounts`:

```
php artisan accounting:update
```

Re-publishes views, assets, config, JS; runs new migrations; syncs DB objects.

---

Route Configuration
-------------------

[](#route-configuration)

By default the package uses the `/accounting/` URL prefix. To change it:

```
# .env
ACCOUNTING_ROUTE_PREFIX=settings        # URLs: /settings/journal-entries, /settings/reports/...
ACCOUNTING_ROUTE_NAME_PREFIX=accounting # Route names stay: accounting.dashboard, accounting.journal-entries.index
```

> Route **names** stay as `accounting.*` regardless of the URL prefix, so views and redirects work without changes.

**Settings-style routes example** (used in our demo):

URLRoute Name`/settings``accounting.dashboard``/settings/journal-entries``accounting.journal-entries.index``/settings/reports/general-ledger``accounting.reports.general-ledger``/settings/chart-of-accounts``accounting.chart-of-accounts.index``/settings/periods``accounting.periods.index``/settings/users``settings.users.index``/settings/roles``settings.roles.index``/settings/permissions``settings.permissions.index`---

Creating Journal Entries — Three Ways
-------------------------------------

[](#creating-journal-entries--three-ways)

### 1. Static Helper — `JournalEntry::record()`

[](#1-static-helper--journalentryrecord)

The fastest way to create a balanced GL entry programmatically:

```
use Alimarchal\LaravelChartOfAccounts\Models\JournalEntry;

// Create a draft entry
$entry = JournalEntry::record(
    description: 'Office rent payment',
    debitAccountCode: '5101',   // Rent Expense
    creditAccountCode: '1101',  // Cash
    amount: 150000,
    post: false,                // save as draft
);

// Create and post immediately
$entry = JournalEntry::record(
    description: 'Salary payment — June 2026',
    debitAccountCode: '6101',   // Salaries Expense
    creditAccountCode: '1101',  // Cash
    amount: 500000,
    post: true,                 // post immediately
    reference: 'SAL-2026-06',
);

echo $entry->status;      // 'posted'
echo $entry->reference;   // 'SAL-2026-06'
echo $entry->id;          // auto-assigned ID
```

**Parameters:**

ParameterTypeRequiredDescription`description``string`YesHuman-readable transaction description`debitAccountCode``string`YesAccount code for the debit line (e.g. `'6101'`)`creditAccountCode``string`YesAccount code for the credit line (e.g. `'1101'`)`amount``float`YesAmount — same value debited AND credited`post``bool`No`true` = post immediately, `false` = draft (default)`reference``string|null`NoOptional voucher/invoice reference number**What it does automatically:**

- Resolves account codes to IDs via `ChartOfAccount`
- Finds active base currency
- Finds currently open accounting period
- Creates entry header + two perfectly balanced lines
- Optionally posts via `JournalEntryService::post()`
- Wraps in a DB transaction

**Returns:** Fresh `JournalEntry` model. **Throws:** `ModelNotFoundException` if account code or open period not found.

---

### 2. REST API

[](#2-rest-api)

**Create a draft entry:**

```
POST /api/accounting/v1/journal-entries
Authorization: Bearer {token}
Content-Type: application/json

{
  "entry_date": "2026-06-04",
  "accounting_period_id": 1,
  "currency_id": 1,
  "fx_rate_to_base": 1,
  "reference": "SAL-2026-06",
  "description": "Salary payment June 2026",
  "lines": [
    { "chart_of_account_id": 42, "debit": 500000, "credit": 0, "description": "Salaries Expense" },
    { "chart_of_account_id": 11, "debit": 0, "credit": 500000, "description": "Cash" }
  ]
}
```

**Post entry:**

```
POST /api/accounting/v1/journal-entries/{id}/post
Authorization: Bearer {token}
```

**Reverse entry:**

```
POST /api/accounting/v1/journal-entries/{id}/reverse
Authorization: Bearer {token}
Content-Type: application/json

{ "description": "Reversal of SAL-2026-06" }
```

**Void entry:**

```
POST /api/accounting/v1/journal-entries/{id}/void
Authorization: Bearer {token}
```

**List with filters:**

```
GET /api/accounting/v1/journal-entries?filter[status]=posted&filter[entry_date_from]=2026-06-01&sort=-entry_date
```

---

### 3. Web UI (Blade/Livewire)

[](#3-web-ui-bladelivewire)

Visit `/settings/journal-entries/create` (or `/accounting/journal-entries/create`).

**UI features:**

- All account and cost center dropdowns use **Select2** with search
- Real-time balance status badge (green = balanced, red = not balanced)
- **Save Draft button is disabled until debits = credits** — prevents unbalanced saves
- Live debit/credit totals update as you type

---

Full REST API Reference
-----------------------

[](#full-rest-api-reference)

Base URL: `/api/accounting/v1`

MethodEndpointDescriptionGET/POST`/account-types`List / CreateGET/PUT/DELETE`/account-types/{id}`Show / Update / DeleteGET/POST`/chart-of-accounts`List / CreateGET/PUT/DELETE`/chart-of-accounts/{id}`Show / Update / DeleteGET/POST`/currencies`List / CreateGET`/accounting-periods`List periodsGET/POST`/journal-entries`List / CreateGET`/journal-entries/{id}`Show with linesPUT`/journal-entries/{id}`Update draftPOST`/journal-entries/{id}/post`Post draftPOST`/journal-entries/{id}/void`VoidPOST`/journal-entries/{id}/reverse`ReverseGET/POST`/reconciliations`List / CreateGET`/bank-accounts`ListGET`/cost-centers`ListGET`/tax-codes`ListGET`/tax-rates`ListGET`/account-balance-snapshots`Period-end snapshotsAll list endpoints support `?filter[field]=value`, `?sort=field`, `?page=N`.

---

Configuration
-------------

[](#configuration)

```
php artisan vendor:publish --tag=accounting-config
```

```
// config/accounting.php
return [
    'ui_driver'              => env('ACCOUNTING_UI_DRIVER', 'inertia'),   // 'inertia' or 'blade'
    'route_prefix'           => env('ACCOUNTING_ROUTE_PREFIX', 'accounting'),
    'route_name_prefix'      => env('ACCOUNTING_ROUTE_NAME_PREFIX', 'accounting'),
    'settings_route_prefix'  => env('SETTINGS_ROUTE_PREFIX', 'settings'),
    'api_prefix'             => env('ACCOUNTING_API_PREFIX', 'api/v1/accounting'),
    'middleware'             => ['web', 'auth'],
    'use_permissions'        => true,
    'defaults' => [
        'currency_code'                     => env('ACCOUNTING_BASE_CURRENCY', 'PKR'),
        'cash_account_code'                 => env('ACCOUNTING_CASH_ACCOUNT_CODE', '1101'),
        'bank_account_code'                 => env('ACCOUNTING_BANK_ACCOUNT_CODE', '1102'),
        'retained_earnings_account_code'    => env('ACCOUNTING_RETAINED_EARNINGS_ACCOUNT_CODE', '3101'),
        'rounding_account_code'             => env('ACCOUNTING_ROUNDING_ACCOUNT_CODE', '5201'),
    ],
];
```

---

Artisan Commands
----------------

[](#artisan-commands)

CommandDescription`accounting:install`Full setup: publish all assets, migrate, seed, sync, verify`accounting:update`Re-publish assets + sync DB after package upgrade`accounting:seed`Seed account types, currencies, COA, permissions, periods`accounting:sync-db-objects`Sync database views, triggers, stored procedures`accounting:verify`Verify accounting data integrity`accounting:health-check`Run accounting health checks`accounting:rebuild-snapshots`Rebuild account balance snapshots`accounting:close-fiscal-year`Close the current fiscal year`accounting:close-period`Close the current accounting period`accounting:open-period`Open a new accounting period---

Models &amp; Tables
-------------------

[](#models--tables)

ModelTableDescription`AccountType``accounting_account_types`Asset, Liability, Equity, Revenue, Expense`ChartOfAccount``accounting_chart_of_accounts`Hierarchical account tree`Currency``accounting_currencies`Currencies and exchange rates`AccountingPeriod``accounting_periods`Fiscal periods with open/close state`JournalEntry``accounting_journal_entries`Entry header (draft/posted/void/reversed)`JournalEntryLine``accounting_journal_entry_lines`Debit/credit lines`BankAccount``accounting_bank_accounts`Bank account register`Reconciliation``accounting_reconciliations`Bank reconciliation records`TaxCode``accounting_tax_codes`Tax code definitions`TaxRate``accounting_tax_rates`Tax rates per code`AccountingAuditLog``accounting_audit_logs`Full change audit trail`AccountBalanceSnapshot``accounting_account_balance_snapshots`Period-end snapshots`CostCenter``accounting_cost_centers`Departmental cost centers---

Permissions
-----------

[](#permissions)

PermissionDescription`accounting.view`View all accounting screens`accounting.manage-settings`Manage roles, users, periods`account-types.view/create/update/delete`Account type CRUD`currencies.view/create/update/delete`Currency CRUD`periods.view/create/update/delete/close/reopen`Period management`chart-of-accounts.view/create/update/delete`COA CRUD`cost-centers.view/create/update/delete`Cost center CRUD`journal-entries.view/create/update/delete/post/reverse/void`Journal entry workflow`bank-accounts.view/create/update/delete`Bank account CRUD`reconciliations.view/create/update/delete`Reconciliation CRUD`tax-codes.view/create/update/delete`Tax code CRUD`tax-rates.view/create/update/delete`Tax rate CRUD`account-balance-snapshots.view`View balance snapshots`reports.*.view`View individual reports (GL, TB, BS, IS, CF, AR, AP, BB, CB, AB)`audit-logs.view`View audit trail`user.view/create/update/delete/assign-role/assign-permission`User managementRoles: `super-admin` (all), `admin`, `accountant`, `viewer`.

---

Select2 Integration
-------------------

[](#select2-integration)

All `` elements use **Select2 4.1.0** served from `public/vendor/accounting/`:

```
public/vendor/accounting/jquery.min.js       — jQuery 3.5.1
public/vendor/accounting/select2.min.js      — Select2 4.1.0
public/vendor/accounting/select2.min.css     — Select2 CSS

```

Falls back to CDN if assets not published.

**Journal entry line dropdowns** use Select2 with full Livewire compatibility:

- Destroyed and re-initialized on every `livewire:updated` event
- Native `change` event fired after Select2 selection to sync with Livewire state

To re-publish:

```
php artisan vendor:publish --tag=accounting-assets --force
```

---

Double-Entry Workflow
---------------------

[](#double-entry-workflow)

StatusDescription**Draft**Editable, not in balances**Posted**Locked, balances updated, period must be open**Reversed**Counter-entry with swapped debits/credits (GAAP method)**Voided**Cancelled without counter-entryBalance is enforced at three layers:

1. **UI** — Save button disabled until balanced; real-time status badge
2. **Application** — `save()` rejects if `|debits − credits| ≥ 0.01`
3. **Service** — `JournalEntryService::post()` validates before posting

---

FAQ
---

[](#faq)

**Q: How do I change the URL from `/accounting/` to `/settings/`?**A: Add `ACCOUNTING_ROUTE_PREFIX=settings` to `.env`. Route names stay `accounting.*` so no view changes needed.

**Q: Does this work with Jetstream (Livewire)?**A: Yes. Set `ACCOUNTING_UI_DRIVER=blade` in `.env` before `accounting:install`.

**Q: How do I update after a package upgrade?**A: Run `php artisan accounting:update`.

**Q: Can I create GL entries without the UI?**A: Yes — use `JournalEntry::record(description, debitCode, creditCode, amount, post: true)`.

**Q: Why is the Save button disabled?**A: Debits and credits must be equal before saving. Enter matching amounts in the debit/credit columns.

**Q: What is `accounting:update`?**A: Re-publishes views, assets, config with `--force`, runs new migrations, syncs DB objects. Run after every `composer update`.

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for full version history.

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

---

Contact &amp; Support
---------------------

[](#contact--support)

- **Author:** Ali Raza Marchal
- **Email:**
- **Issues:** [github.com/alimarchal/laravel-chart-of-accounts-package/issues](https://github.com/alimarchal/laravel-chart-of-accounts-package/issues)
- **Packagist:** [packagist.org/packages/alimarchal/laravel-chart-of-accounts](https://packagist.org/packages/alimarchal/laravel-chart-of-accounts)

---

Keywords
--------

[](#keywords)

`laravel accounting` · `laravel chart of accounts` · `laravel double-entry bookkeeping` · `laravel journal entries` · `laravel general ledger` · `laravel trial balance` · `laravel balance sheet` · `laravel income statement` · `laravel cash flow` · `laravel bank reconciliation` · `laravel ERP` · `laravel GAAP` · `laravel IFRS` · `double entry bookkeeping php` · `accounting package for laravel` · `laravel COA` · `laravel multi-currency` · `laravel financial reports` · `laravel accounting module`

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Every ~0 days

Total

13

Last Release

50d ago

Major Versions

v0.0.1 → v1.2.12026-06-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23615447?v=4)[Ali Raza Marchal](/maintainers/alimarchal)[@alimarchal](https://github.com/alimarchal)

---

Top Contributors

[![alimarchal](https://avatars.githubusercontent.com/u/23615447?v=4)](https://github.com/alimarchal "alimarchal (121 commits)")

---

Tags

laravellivewireinertiaAccountingdouble entrychart of accountsjournal-entriesfinancial-reports

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/alimarchal-laravel-chart-of-accounts/health.svg)

```
[![Health](https://phpackages.com/badges/alimarchal-laravel-chart-of-accounts/health.svg)](https://phpackages.com/packages/alimarchal-laravel-chart-of-accounts)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k21](/packages/fleetbase-core-api)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)

PHPackages © 2026

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