Download the PHP package amrachraf6699/laravel-idempotency-ledger without Composer
On this page you can find all versions of the php package amrachraf6699/laravel-idempotency-ledger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amrachraf6699/laravel-idempotency-ledger
More information about amrachraf6699/laravel-idempotency-ledger
Files in amrachraf6699/laravel-idempotency-ledger
Package laravel-idempotency-ledger
Short Description Conservative, database-backed HTTP idempotency for Laravel.
License MIT
Informations about the package laravel-idempotency-ledger
Laravel Idempotency Ledger
Conservative, database-backed HTTP idempotency for Laravel 10–13 APIs. It prevents duplicate execution for a scoped Idempotency-Key and replays supported completed responses.
Installation
Usage
Apply the idempotent middleware after authentication:
Clients send one random key per logical operation:
The package scopes keys to the authenticated identity by default. Public and multi-tenant APIs must provide a ScopeResolver in config/idempotency.php.
Behavior
- Supported buffered 2xx–4xx responses are stored for 24 hours and replayed with
Idempotency-Replayed: true. - Reusing a key with a changed method, route, content type, or body returns
422. - A concurrent request returns
409andRetry-After: 1. - 5xx responses and unexpected exceptions become
indeterminate; the package will not execute them again automatically. - Throw
RetryableIdempotencyExceptiononly when no irreversible side effect began. It returns503, and the next identical request may claim a new attempt. - Streams, downloads, binary responses, oversized bodies, and undecryptable stored bodies are completed but non-replayable, so duplicate execution remains blocked.
Response bodies are encrypted using Laravel's encrypter. Set a dedicated, stable IDEMPOTENCY_HASH_KEY in production. Do not rotate that key while ledger records may still be queried.
Cleanup
Schedule idempotency:prune. It removes expired completed records and marks overdue processing claims as indeterminate; it never retries or removes indeterminate records.
Development
All versions of laravel-idempotency-ledger with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0