PHPackages                             open-cetacean/laravel-json-header - 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. [Framework](/categories/framework)
4. /
5. open-cetacean/laravel-json-header

ActiveLibrary[Framework](/categories/framework)

open-cetacean/laravel-json-header
=================================

Middleware to force Laravel API group to JSON header

v1.0(9y ago)0757MITPHPPHP &gt;=5.6.4

Since Jan 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/open-cetacean/laravel-json-header)[ Packagist](https://packagist.org/packages/open-cetacean/laravel-json-header)[ RSS](/packages/open-cetacean-laravel-json-header/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

**open-cetacean/laravel-json-header** is a PHP package built for Laravel to force Laravel API group to JSON header activating wantsJson()

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

[](#installation)

This project can be installed via [Composer](http://getcomposer.org). Add the following line to the require block of your composer.json file:

```
{
    "require": {
            "open-cetacean/laravel-json-header": "^1.0"
    }

}

```

You'll then run `composer install` or `composer update`.

Or run the following command:

```
composer require open-cetacean/laravel-json-header

```

Middleware
----------

[](#middleware)

To register the middleware add the following to the `$routeMiddleware` array within the `app/Http/Kernel.php` file:

```
protected $routeMiddleware = [
    // ...
    'acceptJson' => \OpenCetacean\JsonHeader\Middleware\AcceptJson::class,
    // ...
];
```

then add the middleware to your API routes:

```
Route::group(['middleware' => ['api', 'acceptJson']], function () {
    // ...
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3393d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fe8d3eb866f0c1c9e55d2fa19e48e4da1effd630f1b08576f87c8de436678b3?d=identicon)[open-cetacean](/maintainers/open-cetacean)

---

Tags

jsonmiddlewareframeworklaravelheader

### Embed Badge

![Health badge](/badges/open-cetacean-laravel-json-header/health.svg)

```
[![Health](https://phpackages.com/badges/open-cetacean-laravel-json-header/health.svg)](https://phpackages.com/packages/open-cetacean-laravel-json-header)
```

###  Alternatives

[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.1k215.3k37](/packages/hprose-hprose)[lanin/laravel-api-debugger

Easily debug your JSON API.

2311.8M](/packages/lanin-laravel-api-debugger)[hprose/hprose-swoole

Hprose asynchronous client &amp; standalone server based on swoole

17928.9k9](/packages/hprose-hprose-swoole)[lanin/laravel-api-exceptions

All in one solution for exception for JSON REST APIs on Laravel and Lumen.

40102.4k](/packages/lanin-laravel-api-exceptions)[davidepastore/slim-config

A slim middleware to read configuration from different files based on hassankhan/config

338.9k1](/packages/davidepastore-slim-config)[saad/api-debugger

Easily debug your JSON API.

1170.1k](/packages/saad-api-debugger)

PHPackages © 2026

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