Download the PHP package amreljako/laravel-ledger-guard without Composer

On this page you can find all versions of the php package amreljako/laravel-ledger-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ledger-guard

Laravel LedgerGuard

Latest Version on Packagist GitHub Stars Total Downloads License

Laravel LedgerGuard is a highly secure, production-grade, and tamper-evident financial ledger system for Laravel. Unlike traditional wallet packages that simply increment/decrement a balance column, LedgerGuard utilizes a strict Double-Entry Bookkeeping architecture combined with Blockchain-like cryptographic chaining and Pessimistic Locking to completely eliminate financial fraud, race conditions, and unauthorized database manipulation.


The Threat Model & Architecture

Traditional database structures for wallets are inherently insecure against multi-threaded application exploits or insider threats. LedgerGuard introduces an immutable infrastructure layer to protect financial records:

Threat Standard Wallet Design LedgerGuard
Race Conditions / Double Spending Vulnerable during high-concurrency requests (e.g., fast sequential API calls). Employs strict database Pessimistic Locking (lockForUpdate) to queue concurrent transactions safely.
Direct Database Tampering If an attacker or malicious insider alters a balance directly in the DB, the system accepts it blindly. Tamper-Evident Hashing Chain: Every transaction is cryptographically chained to the previous one via SHA-256. Any manual alteration breaks the chain and triggers an instant lockdown.
Negative Balance Exploit Relies solely on application-level checks, which can be bypassed via asynchronous requests. Enforces strict unsignedDecimal constraints at the database engine level, making negative data insertion physically impossible.
Data Leakage / Privacy Transaction metadata (e.g., bank notes, user references) is stored in plaintext. Metadata payloads are automatically encrypted at rest using AES-256-GCM.

Key Features


Installation

Install the package via Composer:

Publish and run the secure migrations:

Optionally publish the config file:


Configuration

The published configuration file will be located at config/ledger-guard.php:


Usage & Quick Start

1. Prepare Your Model

Add the HasLedger trait to any Eloquent model you wish to grant a secure financial wallet:


2. Credit Money (Deposits / Inbound)

To safely deposit funds into a model's ledger:


3. Debit Money (Secure Purchases / Payouts)

To safely deduct funds from a wallet, wrapped automatically inside a database transaction with Pessimistic Locking:


4. Fetch the Audited Balance

Calculates the real-time balance via double-entry arithmetic while simultaneously auditing the entire cryptographic signature chain:


Mathematical Cryptographic Chain

Each record inside the ledger_transactions table computes a rolling cryptographic signature:

$$\text{Current Hash} = \text{SHA256}(\text{ledger_id} \parallel \text{type} \parallel \text{amount} \parallel \text{previous_hash} \parallel \text{APP_KEY})$$

If an attacker gains direct access to your SQL database and attempts to alter a transaction amount, the ledger's mathematical equilibrium breaks. Upon the next balance calculation or transaction request, LedgerGuard:

  1. Flags the anomaly
  2. Halts execution
  3. Freezes the account
  4. Throws a Security Violation Exception

All versions of laravel-ledger-guard with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amreljako/laravel-ledger-guard contains the following files

Loading the files please wait ...