PHPackages                             jlozanomaltos/json-reducer - 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. jlozanomaltos/json-reducer

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

jlozanomaltos/json-reducer
==========================

An array size reducer (for JSON output purposes) using Models, Collections, Arrays

v1.0.9(9y ago)9512MITPHPPHP &gt;=5.5.9

Since Jan 23Pushed 9y ago4 watchersCompare

[ Source](https://github.com/jlozano254/JsonReducer)[ Packagist](https://packagist.org/packages/jlozanomaltos/json-reducer)[ RSS](/packages/jlozanomaltos-json-reducer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)DependenciesVersions (10)Used By (0)

JsonReducer
===========

[](#jsonreducer)

What is it?
-----------

[](#what-is-it)

An array size reducer (for JSON output purposes) using Models, Collections, Arrays for Laravel/Lumen

It's basically an implementation of following: [Smaller Serialized Data](http://www.youtube.com/watch?v=qBxeHkvJoOQ)

### Input example (Eloquent Model Array Visualization)

[](#input-example-eloquent-model-array-visualization)

```
{
 "data": [
		{
			"id": 1,
			"name": "Jesús Emanuel",
			"lastname": "Lozano Maltos"
		},
		{
			"id": 2,
			"name": "Gilberto",
			"lastname": "Reyes Barrera"
		}
  ]
}
```

### Output example (Array Visualization)

[](#output-example-array-visualization)

```
{
 "data": {
		{
			"id":[1, 2],
			"name": ["Jesús Emanuel", "Gilberto"],
			"lastname": ["Lozano Maltos", "Reyes Barrera"]
		}
  }
}
```

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

[](#installation)

Require package using composer

```
composer require jlozanomaltos/json-reducer

```

Then just require the class (where you need it)

```
use JLozanoMaltos\JsonReducer\JsonReducer;
```

Example usage (laravel)
-----------------------

[](#example-usage-laravel)

```
public function index()
{
	$users = User::all();
	return response()->json(JsonReducer::reduce($users));
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~85 days

Total

9

Last Release

3408d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d6302c3221f7ad63a88d746b6dce0d6c887fcaf0695b69ce4464d8118e92e1a?d=identicon)[jlozanomaltos](/maintainers/jlozanomaltos)

---

Top Contributors

[![jlozano254](https://avatars.githubusercontent.com/u/8600559?v=4)](https://github.com/jlozano254 "jlozano254 (21 commits)")

---

Tags

jsonlaravellumenreducer

### Embed Badge

![Health badge](/badges/jlozanomaltos-json-reducer/health.svg)

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

###  Alternatives

[danharper/laravel-jsonx

Add XML support to a JSON-speaking Laravel API with a single middleware via JSONx

1857.2k](/packages/danharper-laravel-jsonx)[ernysans/laraworld

Countries, Languages and Time Zones Package for Laravel 5.\*

1755.7k](/packages/ernysans-laraworld)[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)
