PHPackages                             nhatnathando/laravel-api-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. [Testing &amp; Quality](/categories/testing)
4. /
5. nhatnathando/laravel-api-replay

ActiveLibrary[Testing &amp; Quality](/categories/testing)

nhatnathando/laravel-api-replay
===============================

Log, store, and replay Laravel API requests.

v1.0.5(3mo ago)23↓92.3%MITPHPPHP ^8.1

Since Apr 3Pushed 3mo agoCompare

[ Source](https://github.com/NhatNathanDo/laravel-api-replay)[ Packagist](https://packagist.org/packages/nhatnathando/laravel-api-replay)[ RSS](/packages/nhatnathando-laravel-api-replay/feed)WikiDiscussions main Synced today

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

🚀 Laravel API Replay
====================

[](#-laravel-api-replay)

Record incoming HTTP requests and responses, store them efficiently, and replay any request accurately for debugging and comparison via a modern Dashboard.

✨ Features
----------

[](#-features)

- **⚡ Middleware Recording**: Automatically capture Request/Response details.
- **🖥️ Dashboard UI**: Visual interface to browse logs and trigger replays (default at `/api-replay`).
- **🛡️ Production Safety**: **Automatic DB Rollback** for dry-run replays to keep your data safe.
- **🔐 Sensitive Data Masking**: Automatically masks passwords and sensitive headers.
- **🎯 Accurate Replay**: Reconstructs requests using the Laravel HTTP client.
- **🏗️ Artisan Command**: Still supports `php artisan replay:request {uuid}`.

📦 Installation
--------------

[](#-installation)

1. Install via composer:

```
composer require nhatnathando/laravel-api-replay
```

[View on Packagist](https://packagist.org/packages/nhatnathando/laravel-api-replay)

2. Publish configuration, migrations, and UI views:

```
php artisan vendor:publish --tag="api-replay-config"
php artisan vendor:publish --tag="api-replay-migrations"
php artisan vendor:publish --tag="api-replay-views"
```

3. Run migrations:

```
php artisan migrate
```

🛠 Usage
-------

[](#-usage)

### 1. Register Middleware

[](#1-register-middleware)

Add the middlewares to your `app/Http/Kernel.php` (or `bootstrap/app.php` for Laravel 11+):

```
protected $middlewareGroups = [
    'api' => [
        \Storage\ApiReplay\Http\Middleware\RecordApiRequest::class,
        // Optional: Add this to enable automatic DB rollback during Dry Run replays
        \Storage\ApiReplay\Http\Middleware\SimulationMiddleware::class,
    ],
];
```

### 2. Dashboard UI

[](#2-dashboard-ui)

Access the dashboard at `/api-replay` in your browser. You can:

- View all recorded API calls.
- Compare original response vs replay response.
- Enable **Dry Run Mode** to simulate the request without persisting DB changes.

### 3. Programmatic Safety

[](#3-programmatic-safety)

Use the `ApiReplay` helper to skip side-effects (like sending real emails) during a replay:

```
use Storage\ApiReplay\Support\ApiReplay;

if (ApiReplay::isDryRun()) {
    // Skip sending real SMS or calling external 3rd party APIs
    return;
}
```

⚙️ Configuration
----------------

[](#️-configuration)

Check `config/api-replay.php` for options:

- `enabled`: Toggle recording.
- `log_response`: Enable/disable response body logging.
- `sensitive_headers`: List of headers to mask.
- `sensitive_fields`: List of JSON fields to mask.

🧪 Testing
---------

[](#-testing)

```
./vendor/bin/phpunit
```

---

If you find this package useful, please consider supporting my work:

 [![Buy Me a Coffee at ko-fi.com](https://camo.githubusercontent.com/98e68a8a848c0aff42ae688c194b8826ec9b5a8480d9bfbd2caaee987ab3aa7f/68747470733a2f2f73746f726167652e6b6f2d66692e636f6d2f63646e2f6b6f6669362e706e673f763d36)](https://ko-fi.com/F1F81X5SHL)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance82

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Total

6

Last Release

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21d0579daf3d394e46c19dab3fb1d8d5f5fd18f300ff6b6b247a9f215f8c2f29?d=identicon)[NathanDo](/maintainers/NathanDo)

---

Top Contributors

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

---

Tags

testingapilaraveldebugreplay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nhatnathando-laravel-api-replay/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.5k](/packages/larastan-larastan)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

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

1.7k15.1M132](/packages/laravel-pulse)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M195](/packages/laravel-ai)

PHPackages © 2026

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