Download the PHP package meita/journal-guard without Composer
On this page you can find all versions of the php package meita/journal-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download meita/journal-guard
More information about meita/journal-guard
Files in meita/journal-guard
Download meita/journal-guard
More information about meita/journal-guard
Files in meita/journal-guard
Vendor meita
Package journal-guard
Short Description Guard and validate journal entries before they are posted to the ledger.
License MIT
Package journal-guard
Short Description Guard and validate journal entries before they are posted to the ledger.
License MIT
Please rate this library. Is it a good library?
Informations about the package journal-guard
meita/journal-guard
Guard and validate journal entries before they are posted to the ledger. Built for Laravel 10/11/12 with extensible rule classes and clear, human-readable errors.
Installation
Configuration
config/journal-guard.php ships with:
enabled: toggle the guard.mode:strict(throws) orwarning(returns warnings, no throw).rules: ordered list of rule classes.account_model,period_model,currency_model: optional model classes for built-in rules.resolvers.account|period|currency: optional callbacks to resolve accounts/periods/currency without coupling to models.default_currency,enforce_default_currency: enforce default currency when needed.
Example resolver registration:
Usage
Validating a payload
Warning mode
Trait for services
Custom rules
Create a rule implementing Meita\JournalGuard\Contracts\RuleInterface and add it to the rules config array.
Middleware-like usage
Built-in rules
- BalancedRule: total debit equals total credit; totals must be > 0.
- PositiveAmountsRule: no negatives, no line with both debit and credit, no empty amounts.
- AccountsActiveRule: accounts exist and are active (via resolver or configured model).
- ClosedPeriodRule: entry date falls within an open period (resolver or model).
- CurrencyRule: currency allowed for the company and default currency enforcement.
Events
JournalValidatingJournalValidatedJournalRejected
Hook into these with Laravel's event listeners to log, audit, or instrument validation.
All versions of journal-guard with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/events Version ^10.0 || ^11.0 || ^12.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/events Version ^10.0 || ^11.0 || ^12.0
The package meita/journal-guard contains the following files
Loading the files please wait ...