PHPackages                             respect/data - 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. respect/data

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

respect/data
============

Persistence simplified

0.2.2(11y ago)1521.2k↓13.3%3[1 PRs](https://github.com/Respect/Data/pulls)1BSD StylePHPPHP &gt;=5.3.0CI passing

Since Dec 17Pushed 3mo ago6 watchersCompare

[ Source](https://github.com/Respect/Data)[ Packagist](https://packagist.org/packages/respect/data)[ Docs](http://respect.li/)[ RSS](/packages/respect-data/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (1)

Respect\\Data
=============

[](#respectdata)

[![Latest Version](https://camo.githubusercontent.com/e9e6b7a1d7e6266ec9124efdb30f1a804d1bcad0e665ab8396d21da838f78c29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726573706563742f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/respect/data)[![Total Downloads](https://camo.githubusercontent.com/0e5c973e56820db0c39f6bb87e8f00a23e93ce4a70f2993f63ac2da75b1e67ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726573706563742f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/respect/data)[![License](https://camo.githubusercontent.com/bd58ccadcf8ec42214b0615eb1330f3213b2ca9a1aaabdd1c4271e506b8fb15a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726573706563742f646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/respect/data)

Respect\\Data allows you to use multiple, cooperative database mapping with a single solid API. You can even mix out MySQL and MongoDB databases in a single model.

**This project is a work in progress**

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

[](#installation)

The package is available on [Packagist](https://packagist.org/packages/respect/data). You can install it using [Composer](http://getcomposer.org).

```
composer require respect/data
```

PSR-0 and PSR-2 compatible.

Collections
-----------

[](#collections)

The main component for Respect\\Data are Collections. They define how data is grouped in your application.

In the example below, we're declaring two collections for dealing with a news portal:

```
$articles = Collection::article();
$authors = Collection::article()->author();
```

Backends
--------

[](#backends)

Currently, Respect\\Data has two planned backend implementations: Respect\\Relational for relational databases like MySQL and SQLite and Respect\\Structural for MongoDB databases. These are different mappers that use the Respect\\Data model.

Below is a sample of how to retrieve all authors from the author 5:

```
$mapper->article->author[5]->fetchAll();
```

- On the Relational backend, Respect would automatically build a query similar to `SELECT * FROM article INNER JOIN author ON article.author_id = author.id WHERE author.id = 5`.
- On the Structural backend for MongoDB, the generated internal query would be something like `db.article.find({"author.id":5}, {"author":1});`.

Features
--------

[](#features)

Besides fetching data from databases, Respect\\Data is expected to deal with several other scenarios:

- Persisting data into collections
- Using backend-native extra commands in queries
- Declaring shortcuts for large collection declarations
- Handling composite mapper backends

License
-------

[](#license)

See [LICENSE](LICENSE) file.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance53

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.6% 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 ~187 days

Total

5

Last Release

4151d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202642?v=4)[Alexandre Gomes Gaigalas](/maintainers/alganet)[@alganet](https://github.com/alganet)

![](https://avatars.githubusercontent.com/u/154023?v=4)[Henrique Moody](/maintainers/henriquemoody)[@henriquemoody](https://github.com/henriquemoody)

![](https://www.gravatar.com/avatar/aef3ebfba857504b29c8c54d3df12397cec9cc4b1a0890a799a7dc8d9c8c01ad?d=identicon)[Respect](/maintainers/Respect)

![](https://www.gravatar.com/avatar/4343df4adee634d5953da73aa5b61e4af61dbd37bf4e97449240c8a32c142dc5?d=identicon)[augustohp](/maintainers/augustohp)

![](https://www.gravatar.com/avatar/8461d129ec2a8e71314cd38732415a963c4ab3c842db9fb08355a8960016cb8e?d=identicon)[tonicospinelli](/maintainers/tonicospinelli)

---

Top Contributors

[![alganet](https://avatars.githubusercontent.com/u/202642?v=4)](https://github.com/alganet "alganet (30 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (18 commits)")[![nickl-](https://avatars.githubusercontent.com/u/1404606?v=4)](https://github.com/nickl- "nickl- (6 commits)")[![rogeriopradoj](https://avatars.githubusercontent.com/u/443391?v=4)](https://github.com/rogeriopradoj "rogeriopradoj (1 commits)")[![zeebinz](https://avatars.githubusercontent.com/u/341424?v=4)](https://github.com/zeebinz "zeebinz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/respect-data/health.svg)

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

###  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)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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