PHPackages                             otim-otim/bookkeeper - 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. [Database &amp; ORM](/categories/database)
4. /
5. otim-otim/bookkeeper

ActiveLibrary[Database &amp; ORM](/categories/database)

otim-otim/bookkeeper
====================

A Laravel package for double-entry bookkeeping and accounting statements.

1.0.1(3mo ago)0221MITPHPPHP ^8.1

Since Apr 2Pushed 3mo agoCompare

[ Source](https://github.com/otim-otim/BookKeeper)[ Packagist](https://packagist.org/packages/otim-otim/bookkeeper)[ RSS](/packages/otim-otim-bookkeeper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

BookKeeper — Laravel Accounting Package
=======================================

[](#bookkeeper--laravel-accounting-package)

A **double-entry bookkeeping** package for Laravel. Install it in any Laravel application to get a full chart of accounts, journal entry recording, and financial statement generation out of the box.

---

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

[](#installation)

### 1. Add the package via Composer

[](#1-add-the-package-via-composer)

```
composer require otimdibossman/bookkeeper
```

Laravel auto-discovery will automatically register the `BookKeeperServiceProvider` and the `BookKeeper` facade.

### 2. Run the migrations

[](#2-run-the-migrations)

```
php artisan migrate
```

Or publish the migrations to customise them first:

```
php artisan vendor:publish --tag=bookkeeper-migrations
php artisan migrate
```

---

Quick Start
-----------

[](#quick-start)

### Create accounts

[](#create-accounts)

```
use OtimOtim\BookKeeper\Facades\BookKeeper;
use OtimOtim\BookKeeper\Enums\AccountType;

// Chart of accounts
BookKeeper::createAccount('1000', 'Cash',             AccountType::Asset);
BookKeeper::createAccount('1100', 'Accounts Receivable', AccountType::Asset);
BookKeeper::createAccount('2000', 'Accounts Payable', AccountType::Liability);
BookKeeper::createAccount('3000', 'Owner Capital',    AccountType::Equity);
BookKeeper::createAccount('4000', 'Sales Revenue',    AccountType::Revenue);
BookKeeper::createAccount('5000', 'Cost of Goods',    AccountType::Expense);
```

### Record a journal entry (double-entry)

[](#record-a-journal-entry-double-entry)

```
BookKeeper::record([
    ['account' => '1000', 'type' => 'debit',  'amount' => 1500.00, 'memo' => 'Cash received'],
    ['account' => '4000', 'type' => 'credit', 'amount' => 1500.00, 'memo' => 'Sale of goods'],
], [
    'date'      => '2024-03-01',
    'memo'      => 'Cash sale to customer',
    'reference' => 'INV-2024-001',
]);
```

The package will throw `UnbalancedEntryException` if debits ≠ credits.

### Transfer (convenience method)

[](#transfer-convenience-method)

```
// Debit Cash, Credit Revenue — in one call
BookKeeper::transfer('1000', '4000', 2000.00, [
    'memo'      => 'Payment received',
    'reference' => 'PAY-001',
]);
```

### Check an account balance

[](#check-an-account-balance)

```
$balance = BookKeeper::balance('1000');           // current balance
$balance = BookKeeper::balanceAsOf('1000', '2024-12-31'); // historical
```

---

Financial Statements
--------------------

[](#financial-statements)

### Balance Sheet

[](#balance-sheet)

```
$sheet = BookKeeper::balanceSheet('2024-12-31');

// Returns: assets, liabilities, equity, totals, balanced (bool)
dump($sheet['totals']);
// ['assets' => 50000, 'liabilities' => 20000, 'equity' => 30000, 'liabilities_equity' => 50000]
```

### Income Statement (Profit &amp; Loss)

[](#income-statement-profit--loss)

```
$pl = BookKeeper::incomeStatement('2024-01-01', '2024-12-31');

dump($pl['totals']);
// ['revenue' => 80000, 'expenses' => 45000, 'net_income' => 35000]
```

### Trial Balance

[](#trial-balance)

```
$trial = BookKeeper::trialBalance('2024-12-31');

dump($trial['balanced']); // true
dump($trial['totals']);   // ['debits' => 120000, 'credits' => 120000]
```

### General Ledger

[](#general-ledger)

```
$account = BookKeeper::account('1000');
$ledger  = BookKeeper::generalLedger($account, '2024-01-01', '2024-12-31');

// Returns all transaction lines for the account with running details
```

---

Direct Service Access
---------------------

[](#direct-service-access)

You can also inject the services directly:

```
use OtimOtim\BookKeeper\Services\AccountService;
use OtimOtim\BookKeeper\Services\LedgerService;
use OtimOtim\BookKeeper\Services\StatementService;

class MyController
{
    public function __construct(
        private AccountService   $accounts,
        private LedgerService    $ledger,
        private StatementService $statements,
    ) {}
}
```

---

Account Types
-------------

[](#account-types)

TypeNormal BalanceStatement`Asset`DebitBalance Sheet`Liability`CreditBalance Sheet`Equity`CreditBalance Sheet`Revenue`CreditIncome Statement`Expense`DebitIncome Statement---

Database Tables
---------------

[](#database-tables)

TablePurpose`bookkeeper_accounts`Chart of accounts`bookkeeper_journal_entries`Groups of balanced debits/credits`bookkeeper_transactions`Individual debit/credit lines---

Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

---

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance82

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

90d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39344373?v=4)[Otim Isaac](/maintainers/otim-otim)[@otim-otim](https://github.com/otim-otim)

---

Top Contributors

[![otim-otim](https://avatars.githubusercontent.com/u/39344373?v=4)](https://github.com/otim-otim "otim-otim (25 commits)")

---

Tags

laravelAccountingdouble entrybookkeepingledger

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/otim-otim-bookkeeper/health.svg)

```
[![Health](https://phpackages.com/badges/otim-otim-bookkeeper/health.svg)](https://phpackages.com/packages/otim-otim-bookkeeper)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M624](/packages/spatie-laravel-medialibrary)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M94](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M45](/packages/kirschbaum-development-eloquent-power-joins)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)

PHPackages © 2026

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