A Laravel package for managing financial accounts in banking-related applications.
Provides double-entry bookkeeping, general ledger management, transaction tracking, account liens/freezes, daily balance snapshots, and an end-of-day (EOD) reconciliation command.
- PHP 8.1+
- Laravel 10, 11, or 12
1. Install via Composer:
composer require samlorlah/accountsLaravel's auto-discovery will automatically register the service provider.
2. Publish the config file:
php artisan vendor:publish --provider="Six3\Accounts\AccountServiceProvider" --tag=config3. Publish and run the migrations:
php artisan vendor:publish --provider="Six3\Accounts\AccountServiceProvider" --tag=migrations
php artisan migrate4. (Optional) Publish the seeders:
php artisan vendor:publish --provider="Six3\Accounts\AccountServiceProvider" --tag=seedersEdit config/accounts.php to suit your application.
The package binds AccountingServiceInterface in the service container. Resolve it via dependency injection or directly from the container.
use Six3\Accounts\Contracts\AccountingServiceInterface;
class PaymentService
{
public function __construct(private AccountingServiceInterface $accounts) {}
public function handle(): void
{
// Open a new account
$account = $this->accounts->openAccount(
account_type_code: 'SAV',
customer_id: 1,
account_name: 'John Doe Savings'
);
// Post a double-entry transaction (debit and credit sides must balance)
$result = $this->accounts->postTransaction([
'post_status' => 'entered', // or 'approved' to auto-approve
'narration' => 'Initial deposit',
'value_date' => '2026-04-07',
'debit' => [
['account_no' => '1000000001', 'amount' => '5000.00', 'force_debit' => false],
],
'credit' => [
['account_no' => '1000000002', 'amount' => '5000.00'],
],
]);
// Approve a pending transaction
$this->accounts->approveTransaction(tranId: 'OXG_ABC123');
// Cancel a transaction
$this->accounts->cancelTransaction(tranId: 'OXG_ABC123', comment: 'Duplicate entry');
// Get account balance
$balance = $this->accounts->getAccountBalance(account_no: '1000000001');
// Validate an account number
$validation = $this->accounts->validateAccount(account_no: '1000000001');
// Account enquiry / mini-statement
$statement = $this->accounts->accountEnquiry(
account_no: '1000000001',
start_date: '2026-01-01',
end_date: '2026-04-07'
);
// Transaction journal for a date range
$journal = $this->accounts->transactionJournal(
start_date: '2026-01-01',
end_date: '2026-04-07',
status: 'approved' // 'all', 'entered', 'approved', 'cancelled'
);
}
}use Six3\Accounts\Contracts\AccountingServiceInterface;
$accounts = app(AccountingServiceInterface::class);
$balance = $accounts->getAccountBalance('1000000001');$accounts = app(AccountingServiceInterface::class);
// Place a lien (hold) on an account
$accounts->addLien(
account_no: '1000000001',
amount: 1000.00,
comment: 'Pending court order',
expiry_date: '2026-12-31'
);
// List all liens on an account
$accounts->listLien(account_no: '1000000001');
// Remove a lien by its ID
$accounts->removeLien(lien_id: 3);
// Freeze / unfreeze debit or credit on an account
$accounts->updateFreeze(
account_number: '1000000001',
debit_freeze: true,
credit_freeze: false,
comment: 'Suspicious activity'
);
// Fetch current freeze status
$accounts->fetchFreeze(account_number: '1000000001');$accounts = app(AccountingServiceInterface::class);
$accounts->incomeStatement(date: '2026-04-07');
$accounts->balanceSheetByCategory(date: '2026-04-07');
$accounts->trialBalanceReport(date: '2026-04-07');
$accounts->chartOfAccount();
$accounts->checkEodStatus(date: '2026-04-06');| Command | Description |
|---|---|
php artisan accounts:run-eod |
Run end-of-day processing and balance snapshots |
Account— Core financial accountTransaction— Debit/credit entriesGeneralLedger— GL entriesGlSubCategory— GL sub-categoriesDailyAccountBalance— Daily balance snapshotsAccountLien— Lien (hold) records on an accountAccountFreeze— Account freeze recordsAccountSnapshot— Full account state snapshots
MIT — see LICENSE.