PHPackages                             crysalead/chaos - 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. crysalead/chaos

Abandoned → [crysalead/chaos-orm](/?search=crysalead%2Fchaos-orm)Library[Database &amp; ORM](/categories/database)

crysalead/chaos
===============

Data Abstraction Layer.

13022PHP

Since Feb 11Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/crysalead/chaos)[ Packagist](https://packagist.org/packages/crysalead/chaos)[ RSS](/packages/crysalead-chaos/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Chaos - Domain Modeling Library
===============================

[](#chaos---domain-modeling-library)

[![Build Status](https://camo.githubusercontent.com/3fa4dd6b22d6ba39b4a6124ce262c7035f01b66bbcdce677bdbdb53665592249/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6272616e63682d6d61737465722d626c75652e737667)](https://camo.githubusercontent.com/3fa4dd6b22d6ba39b4a6124ce262c7035f01b66bbcdce677bdbdb53665592249/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6272616e63682d6d61737465722d626c75652e737667)[![Build Status](https://camo.githubusercontent.com/a61c1570cfc0ddc2b49b951e2a928cb5150d1cbaa299ba411fe4d34e94b77673/68747470733a2f2f7472617669732d63692e636f6d2f63727973616c6561642f6368616f732d6f726d2e706e673f6272616e63683d6d6173746572)](https://travis-ci.com/crysalead/chaos-orm)[![Scrutinizer Coverage Status](https://camo.githubusercontent.com/abeb17064c02cc4d83fdfde0cc6ce9ffa5299793fd89ec67bd1c6938acce7d28/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f63727973616c6561642f6368616f732d6f726d2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/crysalead/chaos-orm/?branch=master)

Chaos is an independent, persistence-agnostic layer responsible for defining entities' business logic and relationships. It allows to describe a [Domain Model](https://en.wikipedia.org/wiki/Domain_model) without any assumption about the persistence layer.

> Note: The Chaos syntax is derived from [li3](http://li3.me/). If the syntax is not fully compatible with its predecessor, some effort has been made to keep the same clean and beautiful syntax.

Available datasources libraries:

- [chaos-database](https://github.com/crysalead/chaos-database): supports MySQL and PostgreSQL.

Chaos dramatically simplify the developpment of a datasources libraries by providing all persistence-agnostic logic like relationships, eager/lazy loading, validations, etc. at the root level. The only requirement is the datasource you envisionned to use need to be able to fetch a record/document thanks to a unique identifier (i.e no composite primary key).

Requirements
------------

[](#requirements)

- PHP 5.5+

Main Features
-------------

[](#main-features)

- Support eager/lazy loading
- Support custom finders
- Support nested saving
- Support nested validations
- Support external &amp; embedded relationship
- Support custom types &amp; entities' field casting

Example of syntax:
------------------

[](#example-of-syntax)

```
use My\Project\Model\Images;

// Adding a many-to-many relation
$image = Image::load(123);
$image->tags[] = ['name' => 'Landscape'];
$image->broadcast();

foreach($image->tags as $tag) { // Echoes: 'Montain', 'Black&White', 'Landscape'
    echo $tag->name;
}
```

Documentation
-------------

[](#documentation)

See the whole [documentation here](http://chaos.readthedocs.org/en/latest).

### Testing

[](#testing)

The spec suite can be runned with:

```
cd chaos
composer install
./bin/kahlan

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance40

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c78f317fdfb9f077b1f16c88193192f7562e999c536b25943b759c3b5099fb?d=identicon)[jails](/maintainers/jails)

---

Top Contributors

[![jails](https://avatars.githubusercontent.com/u/1306941?v=4)](https://github.com/jails "jails (280 commits)")

### Embed Badge

![Health badge](/badges/crysalead-chaos/health.svg)

```
[![Health](https://phpackages.com/badges/crysalead-chaos/health.svg)](https://phpackages.com/packages/crysalead-chaos)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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