PHPackages                             boone-studios/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. [API Development](/categories/api)
4. /
5. boone-studios/laravel-idempotency

ActiveLibrary[API Development](/categories/api)

boone-studios/laravel-idempotency
=================================

Stripe-style Idempotency-Key middleware for multi-tenant Laravel APIs.

v0.1.1(1mo ago)050↓73.3%MITPHPPHP ^8.2

Since Jul 11Pushed 1mo agoCompare

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

READMEChangelogDependencies (7)Versions (3)Used By (0)

boone-studios/laravel-idempotency
=================================

[](#boone-studioslaravel-idempotency)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Used by Forgebit](https://camo.githubusercontent.com/187290bd460f372218fece58ee3e7bbb592808bc411bd6a4aa22170503c5a496/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7573656425323062792d466f7267656269742d616d626572)](https://forgebit.io)

Stripe-style `Idempotency-Key` middleware for multi-tenant Laravel APIs.

- Requires an idempotency header on mutating requests
- Cache-locks concurrent retries
- Replays the stored response on matching payload
- Returns `409 Conflict` when the same key is reused with a different body
- Prunes expired records via Eloquent's `Prunable`

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12 or 13

Installation
------------

[](#installation)

```
composer require boone-studios/laravel-idempotency
```

```
php artisan vendor:publish --tag=idempotency-config
php artisan vendor:publish --tag=idempotency-migrations
php artisan migrate
```

Configuration
-------------

[](#configuration)

**`scope_resolver` must be configured before you use this middleware.** There is no default implementation — the package ships as `null` and will throw a `RuntimeException` at request time (with a message pointing back to this config key) if you register the `idempotency` middleware on a route without setting it first.

Implement `BooneStudios\Idempotency\Contracts\ResolvesIdempotencyScope` and set it in `config/idempotency.php`:

```
'scope_resolver' => App\Services\TenantContext::class,
'scope_column' => 'tenant_id', // or vendor_id, organization_id, …
```

Register the middleware:

```
Route::middleware('idempotency')->post('/orders', …);
```

Only apply the `idempotency` middleware to routes where a scope/tenant is always resolvable (e.g. authenticated, tenant-scoped endpoints). Routes that legitimately have no tenant yet (e.g. a signup endpoint) should not use this middleware — resolution failure is treated as a configuration error, not a "no tenant" case.

License
-------

[](#license)

MIT © Boone Studios, LLC

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76f1c4c8777cc7686e9ccd81c8f8deed5c4f443d7ca85cb4b78984acba7dd31c?d=identicon)[boonestudios](/maintainers/boonestudios)

---

Top Contributors

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

---

Tags

middlewareapilaravelidempotency

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k17.6M165](/packages/laravel-pulse)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58190.1k22](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45945.2k1](/packages/pressbooks-pressbooks)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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