PHPackages                             matraux/json-orm - 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. matraux/json-orm

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

matraux/json-orm
================

A PHP 8.5+ library for converting JSON data to typed entities and back, with support for lazy-loading collections.

4.0.0(1mo ago)1970MITPHPPHP &gt;=8.5CI passing

Since May 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/matraux/json-orm)[ Packagist](https://packagist.org/packages/matraux/json-orm)[ RSS](/packages/matraux-json-orm/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (15)Versions (17)Used By (0)

MATRAUX JSON ORM
================

[](#matraux-json-orm)

[![Latest Version on Packagist](https://camo.githubusercontent.com/84779f82c0403cad017be958a399f894a4fc7634ab5ddb94d25faaf7ef8a49ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6174726175782f6a736f6e2d6f726d2e7376673f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/matraux/json-orm)[![License: MIT](https://camo.githubusercontent.com/aaaf7fce1d44e884300a55df2c82406f416bc1e5009859d78aedbb69249e4611/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f6c6f676f3d6f70656e2d736f757263652d696e6974696174697665266c6f676f436f6c6f723d7768697465)](LICENSE)[![PHP](https://camo.githubusercontent.com/4be3868491eb3a416424b55980646197065c189cbc6a20fbcb8b2743e6bd7c67/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e352b2d626c75652e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![Security Policy](https://camo.githubusercontent.com/33427022d3760656f0ff395d8f48f1230d42ba200881fbcc019aabadf2ffabe8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656375726974792d506f6c6963792d626c75653f6c6f676f3d62697477617264656e266c6f676f436f6c6f723d7768697465)](./.github/SECURITY.md)[![Contributing](https://camo.githubusercontent.com/bd7eaa3d90ef7ad126e208b3b8adf606e0805b6e28c8c38aa16d52fb38ac7fb5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e747269627574696e672d44697361626c65642d6c69676874677265793f6c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](CONTRIBUTING.md)[![QA Status](https://camo.githubusercontent.com/e6a28c492dffe490978cb07ab4d3b85e41e8da7a6cf3080fd876d839a3392d7e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6174726175782f6a736f6e2d6f726d2f71612e796d6c3f6c6162656c3d5175616c6974792b4173737572616e6365266c6f676f3d636865636b6d617278266c6f676f436f6c6f723d7768697465)](https://github.com/matraux/json-orm/actions/workflows/qa.yml)[![Issues](https://camo.githubusercontent.com/839af7dd3a7f44c418aa3deec4e63b173995d5969dd768c5599a782a44e407df/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6d6174726175782f6a736f6e2d6f726d3f6c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://github.com/matraux/json-orm/issues)[![Last Commit](https://camo.githubusercontent.com/6e2d0b8b9d31a6e4bedec223e217a95c57cb95173282a212c20828d1fadcb5ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6d6174726175782f6a736f6e2d6f726d3f6c6f676f3d676974266c6f676f436f6c6f723d7768697465)](https://github.com/matraux/json-orm/commits)

Introduction
------------

[](#introduction)

A PHP 8.5+ library for converting JSON data to typed entities and back, with support for lazy-loading collections, mutable data structures, and structured entity design. Useful for structured JSON APIs, configuration parsing, and object-based manipulation of hierarchical JSON data.

Features
--------

[](#features)

- Object-oriented JSON mapping
- Conversion from JSON to typed entities and back
- Lazy-loading collections for efficient memory usage
- Entity objects are mutable and can be freely modified after creation
- Strict type support with automatic casting and codec transformations
- Native support for nested structures and arrays
- Easy integration with configuration or API responses

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

[](#installation)

```
composer require matraux/json-orm
```

PHP compatibility
-----------------

[](#php-compatibility)

This package provides separate major versions for different PHP baselines.

VersionPHP1.x7.4+2.x8.3+3.x8.4+4.x8.5+
Examples
--------

[](#examples)

See [Definitions](./docs/Definitions.md) for how to define your own entities and collections.

See [Read](./docs/Read.md) for full reading examples.

```
use Matraux\JsonOrm\Json\SimpleExplorer;

// Load data from JSON string or file
$explorer = SimpleExplorer::fromString('[{"CUSTOM_ID":1,"name":"First"}]');

// Create typed collection from JSON
$collection = CommonCollection::fromExplorer($explorer);

$entity = $collection[0];
echo $entity->name; // "First"
```

See [Write](./docs/Write.md) for writing examples.

```
// Create collection and insert entity
$collection = CommonCollection::create();

$entity = $collection->createEntity();
$entity->name = 'Example';

echo json_encode($collection);
// '[{"name":"Example"}]'
```

Development
-----------

[](#development)

See [Development](./docs/Development.md) for debug, test instructions, static analysis, and coding standards.

Support
-------

[](#support)

For bug reports and feature requests, please use the [issue tracker](https://github.com/matraux/json-orm/issues).

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance91

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Recently: every ~0 days

Total

14

Last Release

44d ago

Major Versions

1.4.2 → 2.1.02025-11-25

2.2.0 → 3.0.02026-05-20

1.x-dev → 4.0.02026-05-20

PHP version history (5 changes)1.2.0PHP ^8.4

3.0.0PHP &gt;=8.4

2.0.0PHP &gt;=8.3

1.0.0PHP &gt;=7.4

4.0.0PHP &gt;=8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46919973?v=4)[Daniel Žůrek](/maintainers/matraux)[@matraux](https://github.com/matraux)

---

Top Contributors

[![matraux](https://avatars.githubusercontent.com/u/46919973?v=4)](https://github.com/matraux "matraux (146 commits)")

---

Tags

json-ormMATRAUX

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/matraux-json-orm/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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