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.1k↓50%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 1mo 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 75% 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

4039d 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

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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