PHPackages                             cod-glo/cgaccounting - 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. [Framework](/categories/framework)
4. /
5. cod-glo/cgaccounting

ActiveLibrary[Framework](/categories/framework)

cod-glo/cgaccounting
====================

Accounting package for Laravel

1.0.26(3mo ago)32131MITPHPPHP ^7.3|^8.0

Since Oct 28Pushed 3mo agoCompare

[ Source](https://github.com/sanda0/CGAccounting)[ Packagist](https://packagist.org/packages/cod-glo/cgaccounting)[ RSS](/packages/cod-glo-cgaccounting/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (30)Used By (0)

CGAccounting
============

[](#cgaccounting)

A Laravel package for handling accounting operations, including account management, transactions, and generating financial reports such as profit and loss, balance sheets, and cash flow statements. Easily manage credits, debits, and generate reports with a simple API.

---

Features
--------

[](#features)

- Account Management (Assets, Liabilities, Equity, Income, Expenses)
- Transaction Processing (Credits and Debits)
- Financial Report Generation
    - Profit and Loss Statements
    - Balance Sheets
    - Cash Flow Statements
    - Trial Balance Sheets
- Cheque Management (with status tracking and references)
- Database Migration and Seeding Support
- Built-in Account Types and Structures
- Flexible Transaction References and Descriptions
- Multi-tenancy support (via `MULTI_TENANCY_ENABLED`)

---

Setup Instructions
------------------

[](#setup-instructions)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require cod-glo/cgaccounting
```

### 2. Run Migrations

[](#2-run-migrations)

To set up the database tables, run the migration commands:

```
php artisan migrate
```

This will create the required tables:

- `accpkg_accounts`: Stores account information and hierarchies
- `accpkg_entries`: Records all transactions and balances
- `cheques`: Stores cheque details and status

### 3. Run Account Seeder

[](#3-run-account-seeder)

To seed the database with initial account data:

```
php artisan db:seed --class=CodGlo\\CGAccounting\\Seeders\\AccountSeeder
```

---

Usage
-----

[](#usage)

### AccountingService

[](#accountingservice)

Handles all transaction-related operations.

#### Credit Transaction

[](#credit-transaction)

```
use CodGlo\CGAccounting\Services\AccountingService;

$accountingService = new AccountingService();
$result = $accountingService->credit(
    'fromAccount',    // Source account name
    'toAccount',      // Destination account name
    100.0,           // Amount
    'ref123',        // Reference ID (optional)
    'type1',         // Reference type (optional)
    'Description',   // Transaction description (optional)
    '2024-01-01'     // Transaction date (optional)
);

if ($result === true) {
    echo "Transaction successful!";
} else {
    echo "Error: " . $result;
}
```

#### Debit Transaction

[](#debit-transaction)

```
use CodGlo\CGAccounting\Services\AccountingService;

$accountingService = new AccountingService();
$result = $accountingService->debit(
    'fromAccount',    // Source account name
    'toAccount',      // Destination account name
    50.0,            // Amount
    'ref456',        // Reference ID (optional)
    'type2',         // Reference type (optional)
    'Refund',        // Transaction description (optional)
    '2024-01-02'     // Transaction date (optional)
);
```

#### Get Account

[](#get-account)

```
$account = $accountingService->getAccount('Cash');
```

#### Get Account Transactions

[](#get-account-transactions)

```
$transactions = $accountingService->getAccountTransactions(
    $account->id,
    '2024-01-01', // Start date (optional)
    '2024-12-31', // End date (optional)
    20            // Results per page (optional)
);
```

#### Get General Ledger

[](#get-general-ledger)

```
$ledger = $accountingService->getGeneralLedger(
    '2024-01-01', // Start date (optional)
    '2024-12-31', // End date (optional)
    50            // Results per page (optional)
);
```

---

### Cheque Management

[](#cheque-management)

Cheques are managed via the `Cheque` model. You can create, update status, and link cheques to transactions using `ref_id` and `ref_type`.

```
use CodGlo\CGAccounting\Models\Cheque;

$cheque = new Cheque([
    'cheque_number' => '123456',
    'cheque_date' => '2024-12-31',
    'type' => 'out',
    'amount' => 5000,
    'payee_name' => 'Supplier Name',
    // ... other fields
]);
$cheque->save();

// Update status
$cheque->updateStatus('cleared');
```

---

### AccountingReportService

[](#accountingreportservice)

Generate financial reports with customizable company information.

#### Initialize Report Service

[](#initialize-report-service)

```
use CodGlo\CGAccounting\Services\AccountingReportService;

$reportService = new AccountingReportService(
    'Company Name',
    'Company Address',
    'Phone Number',
    'Email Address'
);
```

#### Generate Reports

[](#generate-reports)

##### Profit and Loss Report

[](#profit-and-loss-report)

```
$reportUrl = $reportService->generateProfitAndLossReport(
    '2024-01-01',    // Start date
    '2024-12-31',    // End date
    'output/path',   // Optional output path
    'pdf'            // Optional format (pdf/html)
);
```

##### Cash Flow Report

[](#cash-flow-report)

```
$reportUrl = $reportService->generateCashFlow(
    '2024-01-01',    // Start date
    '2024-12-31'     // End date
);
```

##### Balance Sheet

[](#balance-sheet)

```
$reportUrl = $reportService->generateBalanceSheet(
    '2024-12-31'     // As of date
);
```

##### Trial Balance Sheet

[](#trial-balance-sheet)

```
$reportUrl = $reportService->generateTrialBalanceSheet(
    '2024-12-31',    // As of date
    'output/path',   // Optional output path
    'pdf'            // Optional format (pdf/html)
);
```

---

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

[](#account-types)

The package supports standard accounting types:

- Assets
- Liabilities
- Equity
- Income
- Expenses

---

Error Handling
--------------

[](#error-handling)

The package includes validation for:

- Invalid amounts (zero or negative)
- Non-existent accounts
- Invalid account types
- Transaction constraints

---

Multi-Tenancy
-------------

[](#multi-tenancy)

If `MULTI_TENANCY_ENABLED` is set to `true` in your `.env`, the package will use the `sqlite_company` connection for models.

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

---

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance79

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.8% 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 ~18 days

Recently: every ~66 days

Total

26

Last Release

111d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b92d55956d38f32208cd7fd283daaa927b58a77b95a75c3d5e1faeadd059afa?d=identicon)[sanda0](/maintainers/sanda0)

---

Top Contributors

[![sanda0](https://avatars.githubusercontent.com/u/45274219?v=4)](https://github.com/sanda0 "sanda0 (83 commits)")[![Premod1](https://avatars.githubusercontent.com/u/106421882?v=4)](https://github.com/Premod1 "Premod1 (1 commits)")

---

Tags

accountingcomposer-packagedouble-entry-accountingfinancelaravellaravel-packagelaravelpackageAccounting

### Embed Badge

![Health badge](/badges/cod-glo-cgaccounting/health.svg)

```
[![Health](https://phpackages.com/badges/cod-glo-cgaccounting/health.svg)](https://phpackages.com/packages/cod-glo-cgaccounting)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k84.2M225](/packages/laravel-horizon)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)

PHPackages © 2026

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