PHPackages                             malvik-lab/laravel-accept-only-json-response - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. malvik-lab/laravel-accept-only-json-response

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

malvik-lab/laravel-accept-only-json-response
============================================

Block requests that don't accept json in response.

1.0.1(4y ago)050MITPHP

Since Jul 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/malvik-lab/laravel-accept-only-json-response)[ Packagist](https://packagist.org/packages/malvik-lab/laravel-accept-only-json-response)[ RSS](/packages/malvik-lab-laravel-accept-only-json-response/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Laravel accept only Json response
=================================

[](#laravel-accept-only-json-response)

If you need in [Laravel PHP Framework](https://github.com/laravel/laravel) to serve only Json requests, this package is the solution.

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

[](#installation)

```
$ composer require malvik-lab/laravel-accept-only-json-response

```

Use on your routes
------------------

[](#use-on-your-routes)

```
Route::middleware(['malviklab-laravel-accept-only-json-response'])->group(function () {
    // your routes here
});
```

Output (if the request is incorrect)
------------------------------------

[](#output-if-the-request-is-incorrect)

Http status code: 400 Bad Request

```
{
    "error": "Use the \"Accept: application/json\" HTTP Header"
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

2

Last Release

1702d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b05ddd2213c9e2adcdec248828dc26c9290f49df4c3e46d11fcd40baaa651b4a?d=identicon)[malvik-lab](/maintainers/malvik-lab)

---

Top Contributors

[![malvik-lab](https://avatars.githubusercontent.com/u/51824408?v=4)](https://github.com/malvik-lab "malvik-lab (5 commits)")

---

Tags

responsejsonlaravel

### Embed Badge

![Health badge](/badges/malvik-lab-laravel-accept-only-json-response/health.svg)

```
[![Health](https://phpackages.com/badges/malvik-lab-laravel-accept-only-json-response/health.svg)](https://phpackages.com/packages/malvik-lab-laravel-accept-only-json-response)
```

###  Alternatives

[stepanenko3/nova-json

Nova json field to spread a json column throughout multiple fields.

42249.7k](/packages/stepanenko3-nova-json)[json-mapper/laravel-package

The JsonMapper package for Laravel

25170.4k3](/packages/json-mapper-laravel-package)

PHPackages © 2026

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