PHPackages                             generationtux/json-middleware - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. generationtux/json-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

generationtux/json-middleware
=============================

A simple laravel/lumen middleware for denying non-json POST and PUT requests.

v1.2(10y ago)44.7kMITPHP

Since Sep 30Pushed 10y ago21 watchersCompare

[ Source](https://github.com/generationtux/json-middleware)[ Packagist](https://packagist.org/packages/generationtux/json-middleware)[ RSS](/packages/generationtux-json-middleware/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

Json-Middleware
===============

[](#json-middleware)

A simple laravel/lumen middleware for denying non-json POST and PUT requests.

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

[](#installation)

You can install json-middleware via composer.

```
$ composer require generationtux/json-middleware:~1.0

```

Once installed you simply need to register the middleware.

### Laravel

[](#laravel)

You should register the middleware in the `App\Http\Kerenel.php`. You can opt to apply the middleware gloablly to all routes, or simply register it under the routes middelware and manually apply it to specific routes.

```
    /**
     * The application's global HTTP middleware stack.
     *
     * @var array
     */
    protected $middleware = [
        'isjson'  => ValidateIsJsonMiddleware::class
    ];

```

### Lumen

[](#lumen)

Lumen requires you to register the middleware in `bootstrap/app.php` but again you may opt to register the middleware gloablly or not, it's up to you.

```
	/*
	|--------------------------------------------------------------------------
	| Register Middleware
	|--------------------------------------------------------------------------
	|
	| Next, we will register the middleware with the application. These can
	| be global middleware that run before and after each request into a
	| route or middleware that'll be assigned to some specific routes.
	|
	*/
	$app->middleware([
	    GenTux\Json\Http\ValidateIsJsonMiddleware::class
	]);

```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% 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 ~3 days

Total

3

Last Release

3922d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1020137?v=4)[Damien Russell](/maintainers/Olofguard)[@Olofguard](https://github.com/Olofguard)

![](https://www.gravatar.com/avatar/00ecfc3405548aab669dc6966e8a3a55af93dfb4bfe7095ce318a763a323eeeb?d=identicon)[kylegferg](/maintainers/kylegferg)

![](https://www.gravatar.com/avatar/da77b24b3e21b501a4cbda34c86d8154cba42d6960f4a669ff54016e950bbd91?d=identicon)[troyharvey](/maintainers/troyharvey)

---

Top Contributors

[![Olofguard](https://avatars.githubusercontent.com/u/1020137?v=4)](https://github.com/Olofguard "Olofguard (5 commits)")[![thomasbellio](https://avatars.githubusercontent.com/u/5281642?v=4)](https://github.com/thomasbellio "thomasbellio (1 commits)")[![troyharvey](https://avatars.githubusercontent.com/u/530530?v=4)](https://github.com/troyharvey "troyharvey (1 commits)")

### Embed Badge

![Health badge](/badges/generationtux-json-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/generationtux-json-middleware/health.svg)](https://phpackages.com/packages/generationtux-json-middleware)
```

###  Alternatives

[spatie/laravel-webhook-client

Receive webhooks in Laravel apps

1.2k13.2M127](/packages/spatie-laravel-webhook-client)[psalm/plugin-laravel

Psalm plugin for Laravel

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

API Platform support for Laravel

58170.8k14](/packages/api-platform-laravel)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

2038.9k](/packages/onlime-laravel-http-client-global-logger)

PHPackages © 2026

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