PHPackages                             moon/fakemiddleware - 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. moon/fakemiddleware

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

moon/fakemiddleware
===================

A small Laravel 5 package to disable a middleware in testing environment

1.1(11y ago)526.2k↓60.7%1MITPHPPHP &gt;=5.4.0

Since Apr 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/moon0326/FakeMiddleware)[ Packagist](https://packagist.org/packages/moon/fakemiddleware)[ RSS](/packages/moon-fakemiddleware/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

FakeMiddleware
==============

[](#fakemiddleware)

[![](https://camo.githubusercontent.com/1200cfcf7ebc189ef372355a0ab772a389287a15be1023760ae67df2ce1565cc/68747470733a2f2f7472617669732d63692e6f72672f6d6f6f6e303332362f46616b654d6964646c65776172652e737667)](https://camo.githubusercontent.com/1200cfcf7ebc189ef372355a0ab772a389287a15be1023760ae67df2ce1565cc/68747470733a2f2f7472617669732d63692e6f72672f6d6f6f6e303332362f46616b654d6964646c65776172652e737667)

Sometimes you want to disable a middleware/route middleware when testing a controller in Laravel 5. This package simplifies the process.

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

[](#installation)

```
composer require --dev "moon/fakemiddleware": "1.1"

```

Usage
-----

[](#usage)

Open **TestCase.php**, which comes with L5 by default. Locate **createApplication** method and initialize FakeMiddleware.

```
use Moon\FakeMiddleware\FakeMiddleware;

public function createApplication()
{
    $app = require __DIR__.'/../bootstrap/app.php';
    $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

    // This will remove ExternalOAuthVerifier and repalce auth middleware
    // with a fake middleware
    // function __construct(Application $app, $globalMiddlewares, $routeMiddlewares);
    new FakeMiddleware($app, ['App\Http\Middleware\ExternalOAuthVerifier'], ['auth']);

    return $app;
}
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

4085d ago

Major Versions

0.1 → 1.02015-04-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/737453219c222a6a34e24e2883c2225d19753a1032b38f4b13eab490b928079e?d=identicon)[moon0326](/maintainers/moon0326)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moon-fakemiddleware/health.svg)

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

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)

PHPackages © 2026

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