PHPackages                             javidalpe/laravel-idempotency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. javidalpe/laravel-idempotency

ActiveLibrary[Caching](/categories/caching)

javidalpe/laravel-idempotency
=============================

Laravel Idempotency Middleware

1.1(5y ago)2565.9k↓25%6[2 issues](https://github.com/javidalpe/laravel-idempotency/issues)MITPHPPHP &gt;=5.4.0

Since Feb 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/javidalpe/laravel-idempotency)[ Packagist](https://packagist.org/packages/javidalpe/laravel-idempotency)[ RSS](/packages/javidalpe-laravel-idempotency/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Laravel Idempotent Requests
===========================

[](#laravel-idempotent-requests)

First, what is Idempotency and why I need it?

Checkout this awesome [post from Brandum Leach](https://stripe.com/blog/idempotency).

### Install

[](#install)

Require this package with composer using the following command:

```
composer require javidalpe/laravel-idempotency
```

### Usage

[](#usage)

Register Idempotency middleware on your http kernel file:

```
'api' => [
    'throttle:60,1',
    'bindings',
    \Javidalpe\Idempotency\Idempotency::class,
],
```

To perform an idempotent request, provide an additional `Idempotency-Key: ` header to the request.

### How it works

[](#how-it-works)

If the header `Idempotency-Key` is present on the request and the request method is different from GET, PUT and DELETE, the middleware stores the response on the cache. Next time you make a request with same idempotency key, the middleware will return the cached response.

How you create unique keys is up to you, but I suggest using V4 UUIDs or another appropriately random string. It'll always send back the same response for requests made with the same key, and keys can't be reused with different request parameters. Keys expire after 24 hours.

### License

[](#license)

The Laravel Idempotency is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~857 days

Total

2

Last Release

2148d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfc9c78a0ee3561bec8a3ed0d5ababa31ccb90703dc5ed11fd89e06e74f0b243?d=identicon)[javidalpe](/maintainers/javidalpe)

---

Top Contributors

[![javidalpe](https://avatars.githubusercontent.com/u/5345952?v=4)](https://github.com/javidalpe "javidalpe (3 commits)")

---

Tags

apicacheidempotencyidempotentlaravelmiddlewarerestmiddlewareapilaravelidempotency

### Embed Badge

![Health badge](/badges/javidalpe-laravel-idempotency/health.svg)

```
[![Health](https://phpackages.com/badges/javidalpe-laravel-idempotency/health.svg)](https://phpackages.com/packages/javidalpe-laravel-idempotency)
```

###  Alternatives

[flc/laravel-middleware-cache-response

Laravel中间件-Response缓存

608.2k](/packages/flc-laravel-middleware-cache-response)[imliam/laravel-throttle-simultaneous-requests

Throttle the current user's requests based on how many requests are currently being executed.

4623.0k](/packages/imliam-laravel-throttle-simultaneous-requests)[erjanmx/laravel-api-auth

Dead simple Laravel api authorization middleware

2024.5k](/packages/erjanmx-laravel-api-auth)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1065.8k](/packages/moesif-moesif-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
