PHPackages                             eyf/laravel-normalizr - 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. eyf/laravel-normalizr

ActiveLibrary

eyf/laravel-normalizr
=====================

Normalizr Laravel Eloquent API Resources

03221PHP

Since Jun 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/eightyfive/laravel-normalizr)[ Packagist](https://packagist.org/packages/eyf/laravel-normalizr)[ RSS](/packages/eyf-laravel-normalizr/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-normalizr
=================

[](#laravel-normalizr)

Normalizr Laravel Eloquent API Resources

Install
-------

[](#install)

```
composer require eyf/laravel-normalizr

```

Usage
-----

[](#usage)

```
use Eyf\Normalizr\Http\Resources\JsonResource;

class User extends JsonResource
{
  public function toArray($request)
  {
    return [
      'id' => $this->id,
      'name' => $this->name,
      // ...

      'posts' => Post::collection($this->whenLoaded('posts')),
    ];
  }
}
```

### Controller

[](#controller)

Assuming [route model binding](https://laravel.com/docs/7.x/routing#route-model-binding).

```
use App\Http\Resources\User as UserResource;

class UserController extends Controller
{
  public function find(Request $request, User $user)
  {
    $user->loadMissing('posts');

    return new UserResource($user);
  }
}
```

### Response

[](#response)

```
{
  "data": {
    "entities": {
      "users": {
        "1": {
          "id": 1,
          "name": "John",
          "posts": [2, 3]
        }
      },
      "posts": {
        "2": {
          "id": 2,
          "title": "Post 2"
        },
        "3": {
          "id": 3,
          "title": "Post 3"
        }
      }
    },
    "result": 1
  }
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/59643f232849011cd5f39f96d7cbfce556d95002712ff008a414f3eaf67928c3?d=identicon)[eyf](/maintainers/eyf)

### Embed Badge

![Health badge](/badges/eyf-laravel-normalizr/health.svg)

```
[![Health](https://phpackages.com/badges/eyf-laravel-normalizr/health.svg)](https://phpackages.com/packages/eyf-laravel-normalizr)
```

PHPackages © 2026

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