PHPackages                             json-mapper/eloquent-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. [Database &amp; ORM](/categories/database)
4. /
5. json-mapper/eloquent-middleware

ActiveLibrary[Database &amp; ORM](/categories/database)

json-mapper/eloquent-middleware
===============================

The Eloquent middleware for JsonMapper

2.1.0(1y ago)01621[1 issues](https://github.com/JsonMapper/EloquentMiddleware/issues)MITPHPPHP ^7.2 || ^8.0

Since Sep 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/JsonMapper/EloquentMiddleware)[ Packagist](https://packagist.org/packages/json-mapper/eloquent-middleware)[ RSS](/packages/json-mapper-eloquent-middleware/feed)WikiDiscussions develop Synced today

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

  ![JsonMapper logo](https://camo.githubusercontent.com/92c07bc67e17a28dff56bb1bb24368d6e7deac4d451ea04f9142af7a1954bf89/68747470733a2f2f6a736f6e6d61707065722e6e65742f696d616765732f6a736f6e6d61707065722e706e67)---

**This is a Laravel package for using JsonMapper in you Laravel application.**

JsonMapper is a PHP library that allows you to map a JSON response to your PHP objects that are either annotated using doc blocks or use typed properties. For more information see the project website:

[![GitHub](https://camo.githubusercontent.com/b7a571e0a640df4c08c25aa10aca3331d47faa3a55e1083c5854ff48756077ce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4a736f6e4d61707065722f456c6f7175656e744d6964646c6577617265)](https://camo.githubusercontent.com/b7a571e0a640df4c08c25aa10aca3331d47faa3a55e1083c5854ff48756077ce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4a736f6e4d61707065722f456c6f7175656e744d6964646c6577617265)[![Packagist Version](https://camo.githubusercontent.com/9cbeb422e7cb4fc8603a578630756f7f5daf6cfc39371dffb09bcccdc15aafc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a736f6e2d6d61707065722f656c6f7175656e742d6d6964646c6577617265)](https://camo.githubusercontent.com/9cbeb422e7cb4fc8603a578630756f7f5daf6cfc39371dffb09bcccdc15aafc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a736f6e2d6d61707065722f656c6f7175656e742d6d6964646c6577617265)[![PHP from Packagist](https://camo.githubusercontent.com/748bd4b22c93cbc83f8f790a2bbb2ce936520c1f78a27e1fde9abfcf25ff059a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a736f6e2d6d61707065722f656c6f7175656e742d6d6964646c6577617265)](https://camo.githubusercontent.com/748bd4b22c93cbc83f8f790a2bbb2ce936520c1f78a27e1fde9abfcf25ff059a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a736f6e2d6d61707065722f656c6f7175656e742d6d6964646c6577617265)[![Build Status](https://camo.githubusercontent.com/8ff19282f8b337d3ee02eaf3851fd7a91805ea0f88c3b3bf5320df51730bf124/68747470733a2f2f6170692e7472617669732d63692e636f6d2f4a736f6e4d61707065722f456c6f7175656e744d6964646c65776172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/JsonMapper/EloquentMiddleware)[![Coverage Status](https://camo.githubusercontent.com/a359c3b3b33468a1feb1d89d0aee96c1482e2fff7ffd8f311e2a14141220d2dd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a736f6e4d61707065722f456c6f7175656e744d6964646c65776172652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/JsonMapper/EloquentMiddleware?branch=master)

Why use JsonMapper
==================

[](#why-use-jsonmapper)

Continuously mapping your JSON responses to your own objects becomes tedious and is error prone. Not mentioning the tests that needs to be written for said mapping.

JsonMapper has been build with the most common usages in mind. In order to allow for those edge cases which are not supported by default, it can easily be extended as its core has been designed using middleware.

JsonMapper supports the following features

- Case conversion
- Debugging
- DocBlock annotations
- Final callback
- Namespace resolving
- PHP 7.4 Types properties

Installing JsonMapper Eloquent Middleware
=========================================

[](#installing-jsonmapper-eloquent-middleware)

The installation of JsonMapper Eloquent Middleware can easily be done with [Composer](https://getcomposer.org)

```
$ composer require json-mapper/eloquent-middleware
```

The example shown above assumes that `composer` is on your `$PATH`.

Contributing
============

[](#contributing)

Please refer to [CONTRIBUTING.md](https://github.com/JsonMapper/EloquentMiddleware/blob/master/CONTRIBUTING.md) for information on how to contribute to JsonMapper Eloquent Middleware.

List of Contributors
--------------------

[](#list-of-contributors)

Thanks to everyone who has contributed to JsonMapper Eloquent Middleware! You can find a detailed list of contributors of JsonMapper on [GitHub](https://github.com/JsonMapper/EloquentMiddleware/graphs/contributors).

License
=======

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/JsonMapper/EloquentMiddleware/blob/master/LICENSE) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance44

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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

Total

3

Last Release

445d ago

Major Versions

1.0.0 → 2.0.02021-01-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/631515718006cc76dcc92e7672b8d2b265888cb6b5268212081cab15de114e92?d=identicon)[danny.vandersluijs](/maintainers/danny.vandersluijs)

---

Top Contributors

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

---

Tags

hydrationjsonjsonmappermappermappingmiddelwarephpjsonmiddlewarelaraveleloquentmapperjsonmapper

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sleimanx2/plastic

Plastic is an Elasticsearch ODM and mapper for Laravel. It renders the developer experience more enjoyable while using Elasticsearch by providing a fluent syntax for mapping , querying and storing eloquent models.

508141.9k1](/packages/sleimanx2-plastic)[json-mapper/laravel-package

The JsonMapper package for Laravel

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

Provides JSON datatype support for the Eloquent ORM

130245.3k](/packages/darrylkuhn-dialect)[mr-punyapal/laravel-extended-relationships

Package provides additional, more efficient relationship methods for Laravel Eloquent models.

17310.1k](/packages/mr-punyapal-laravel-extended-relationships)[cviebrock/eloquent-typecast

Trait for Eloquent models to force type-casting on retrieved values

2468.0k](/packages/cviebrock-eloquent-typecast)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)

PHPackages © 2026

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