A double-entry accounting engine for Laravel.
Contributions are welcome — bug fixes, new templates, report improvements, and documentation fixes alike.
git clone https://github.com/ringlesoft/laravel-accounting.git
cd laravel-accounting
composer install
The package uses Orchestra Testbench, so there's no separate host Laravel app to set up — tests run against an in-memory skeleton app bootstrapped by Testbench itself.
composer test # Pest test suite
composer test-coverage # Pest with coverage report
composer analyse # PHPStan (see phpstan.neon.dist for the configured level)
composer format # Laravel Pint — fixes code style issues in place
Run composer format before committing; CI (fix-php-code-style-issues.yml) will otherwise auto-commit style fixes to your PR branch, which is noisy. CI also runs Pest (run-tests.yml) and PHPStan (phpstan.yml) on every push — a PR won't be considered until both pass.
AccountPreset enum references over hardcoded account IDs or codes anywhere a template or service resolves an account.AccountingTemplate and implement configure(); only add validate() if the template has a parameter that could silently produce a wrong (not just rejected) posting — see docs/available-templates.md for the pattern.MultiTenant trait, and amounts should flow through VoucherData/VoucherDataItem rather than being written directly to JournalEntryItem.src/Templates/.src/Templates/TemplateRegistry.php if it should be resolvable by key or selectable in a UI picker.docs/available-templates.md (its exact debit/credit accounts and parameters) and cross-reference it in docs/financial-transactions.md if it corresponds to one of the standard transactions listed there.validate() override that rejects it.Open an issue with: the package version, a minimal reproduction (ideally a postWithTemplate()/VoucherData call), the exact exception/output you got, and what you expected instead. For anything touching real financial data correctness (wrong trial balance, wrong report totals), include the actual posted journal entries, not just the symptom.
Do not open a public issue. Email [email protected] instead — see README.md.
docs/available-templates.md or docs/financial-transactions.md alongside any change to template behavior; a PR that changes what a template does without updating its documented behavior will be asked to add it.