Download the PHP package grazulex/laravel-api-idempotency without Composer
On this page you can find all versions of the php package grazulex/laravel-api-idempotency. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download grazulex/laravel-api-idempotency
More information about grazulex/laravel-api-idempotency
Files in grazulex/laravel-api-idempotency
Package laravel-api-idempotency
Short Description RFC-compliant idempotency support for Laravel APIs - Prevent duplicate operations, ensure safe retries
License MIT
Homepage https://github.com/grazulex/laravel-api-idempotency
Informations about the package laravel-api-idempotency
Laravel API Idempotency
Complete API idempotency lifecycle management for Laravel - Prevent duplicate operations, ensure safe retries
Features
- RFC Draft Compliant - Follows IETF Idempotency-Key Header Draft
- Multiple Storage Drivers - Cache, Redis, Database, or DynamoDB
- Payload Fingerprinting - SHA256 verification prevents key reuse with different data
- Conflict Detection - Handles concurrent requests with wait/reject strategies
- Scoping - Scope keys to user, tenant, IP, or custom resolver
- Zero Configuration - Works out of the box with sensible defaults
- Artisan Commands - Stats, cleanup, and management tools
- Testing Helpers - Fluent testing API with
IdempotencyFake
Requirements
- PHP 8.3+
- Laravel 11.x or 12.x
Installation
Publish the configuration:
For database driver, publish migrations:
Quick Start
Apply the middleware to routes:
Client request with idempotency key:
First request: Executes normally, response cached Same key again: Returns cached response, no re-execution
Response Headers
On replay:
Middleware Options
PHP Attributes
Programmatic Usage
Key Generation
Artisan Commands
Events
Configuration
Testing
Integration testing:
Quality Tools
Error Responses
| Code | Status | Description |
|---|---|---|
IDEMPOTENCY_KEY_MISSING |
400 | Key required but not provided |
IDEMPOTENCY_KEY_INVALID |
400 | Key format invalid |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 | Same key, different payload |
IDEMPOTENCY_CONFLICT |
409 | Request in progress with same key |
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Jean-Marc Strauven
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
See Also
- laravel-apiroute - API versioning lifecycle management
- laravel-api-kit - API-only Laravel starter kit
All versions of laravel-api-idempotency with dependencies
illuminate/contracts Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/routing Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0