PHPackages                             revangelista/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. revangelista/laravel-idempotency

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

revangelista/laravel-idempotency
================================

Laravel Idempotency Middleware

1.0.0(5y ago)1110.7k↓50%MITPHPPHP &gt;=5.4.0

Since May 7Pushed 3y ago1 watchersCompare

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

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

Laravel Idempotency Middleware
==============================

[](#laravel-idempotency-middleware)

### Install

[](#install)

Require this package with composer using the following command:

```
composer require revangelista/laravel-idempotency
```

### Usage

[](#usage)

Register Idempotency middleware on your http kernel file:

```
'api' => [
    'throttle:60,1',
    'bindings',
    \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 POST, 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, it is strongly suggest to use 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.

To personalise the idempotency header name and the key expiration, publish config file:

```
php artisan vendor:publish --provider "Idempotency\IdempotencyServiceProvider"

```

And specify in the `.env` file like this:

```
IDEMPOTENCY_HEADER="My-Custom-Idempotency-Key",
IDEMPOTENCY_EXPIRATION=1440 #in minutes
```

Learn more about [Idempotency](https://developer.mozilla.org/en-US/docs/Glossary/Idempotent).

### License

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

1831d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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