PHPackages                             kayrunm/replay - 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. kayrunm/replay

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

kayrunm/replay
==============

A simple package for idempotent requests in Laravel.

2.0.0(3mo ago)51.9k1MITPHPPHP ^8.1

Since Aug 10Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/kayrunm/replay)[ Packagist](https://packagist.org/packages/kayrunm/replay)[ RSS](/packages/kayrunm-replay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (7)Used By (0)

📽 Replay
========

[](#-replay)

A simple package for handling idempotent requests in Laravel.

Any routes using the Replay middleware will check for whether an incoming request meets certain criteria, and if so, it will cache the request for 24 hours so that any subsequent requests will always receive the same response.

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

[](#installation)

Require Replay using Composer:

```
composer require kayrunm/replay
```

Usage
-----

[](#usage)

To get started with using Replay, all you need to do is attach the `Replay` middleware to whichever routes you wish to allow for idempotent requests. For example:

```
use Kayrunm\Replay\Replay;

Route::post('/account/{account}/transfer', [TransferController::class, 'store'])->middleware(Replay::class);
```

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

[](#configuration)

Replay works out-of-the-box, but you can configure it further to fit your needs. To get started, publish the config file with the following command:

```
php artisan vendor:publish --tag="replay"
```

Strategies
----------

[](#strategies)

This package uses the strategy pattern for both determining which requests should be idempotent and for storing their responses in the cache. You can view the default strategies for these below:

- [DefaultCacheStrategy](src/DefaultCacheStrategy.php)
- [DefaultIdempotencyStrategy](src/DefaultIdempotencyStrategy.php)

If you decide to implement your own strategies for either of the above, simply update the config file with the relevant strategies, for example:

```
'strategies' => [

    'caching' => \Acme\CustomCacheStrategy::class,

    'idempotency' => \Acme\CustomIdempotencyStrategy::class,

],
```

You can also customise the header used for the idempotency key (which is used in `DefaultIdempotencyStrategy`, which you could change to use a query parameter, if you wished), as well as how long an idempotent request should stay in the cache (which is used in `DefaultCacheStrategy`)

Licence
-------

[](#licence)

Replay is an open-sourced software licensed under the [MIT](LICENSE) license.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance78

Regular maintenance activity

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% 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 ~315 days

Total

5

Last Release

115d ago

Major Versions

0.1.2 → 1.02022-08-13

1.1 → 2.0.02026-01-23

PHP version history (3 changes)0.1.1PHP ^7.4|^8.0

1.1PHP ^7.4|^8.0|^8.1

2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6943d16d8939d4ce7d5f4d4df1fbb6b12d5d2834bacb07dd2efb82b7ca278377?d=identicon)[kayrunm](/maintainers/kayrunm)

---

Top Contributors

[![kayrunm](https://avatars.githubusercontent.com/u/4512646?v=4)](https://github.com/kayrunm "kayrunm (23 commits)")[![jacretney](https://avatars.githubusercontent.com/u/24294141?v=4)](https://github.com/jacretney "jacretney (1 commits)")

---

Tags

laravelidempotencyidempotent

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kayrunm-replay/health.svg)

```
[![Health](https://phpackages.com/badges/kayrunm-replay/health.svg)](https://phpackages.com/packages/kayrunm-replay)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

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