bluebeetle/idempotency-middleware
Composer 安装命令:
composer require bluebeetle/idempotency-middleware
包简介
Idempotency middleware for your Laravel API.
README 文档
README
Simple and fully tested Laravel middleware for implementing idempotency in your API requests.
Quick Start
composer require bluebeetle/idempotency-middleware
Add the middleware to your routes:
use BlueBeetle\IdempotencyMiddleware\Idempotency; Route::middleware([Idempotency::class])->group(function () { Route::post('/orders', [OrderController::class, 'store']); });
Send requests with an Idempotency-Key header (UUID v4):
POST /api/orders HTTP/1.1
Idempotency-Key: 6b3fd36c-24c6-4eb2-a764-bb6c91b33e56
Content-Type: application/json
{"product_id": 1, "quantity": 2}
Repeated requests with the same key return the cached response instead of processing again.
Documentation
Full documentation is available at bluebeetle.pt/open-source/docs/idempotency-middleware.
Testing
composer test
Credits
License
Licensed under the MIT license.
统计信息
- 总下载量: 972
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-01