PHPackages                             mmx/database - 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. mmx/database

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

mmx/database
============

Eloquent for MODX 3

1.3.1(1y ago)58732[1 issues](https://github.com/bezumkin/mmx-database/issues)6MITPHPPHP &gt;=7.4

Since Mar 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bezumkin/mmx-database)[ Packagist](https://packagist.org/packages/mmx/database)[ RSS](/packages/mmx-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (6)

Eloquent for MODX 3
-------------------

[](#eloquent-for-modx-3)

> This extra is part of **MMX** initiative - the **M**odern **M**OD**X** approach.

### Prepare

[](#prepare)

This package can be installed only with Composer.

If you are still not using Composer with MODX 3, just download the `composer.json` of your version:

```
cd /to/modx/root/
wget https://raw.githubusercontent.com/modxcms/revolution/v3.0.4-pl/composer.json
```

Then run `composer update --no-dev` and you are ready to install the **mmx** packages.

### Install

[](#install)

```
composer require mmx/database --update-no-dev
composer exec mmx-database install
```

### Remove

[](#remove)

```
composer exec mmx-database remove
composer remove mmx/database
```

### How to use

[](#how-to-use)

`mmxDatabase` service will be registered globally, so you can use its models anywhere in your PHP code inside MODX.

Get all published resources with Template and TV values.

```
$resources = \MMX\Database\Models\Resource::query()
    ->with('Template:id,templatename')
    ->with('TvValues')
    ->where('published', true)
    ->get();
foreach ($resources as $resource) {
    print_r($resource->toArray());
}
```

Get categories with relations:

```
$categories = \MMX\Database\Models\Category::query()
    ->with('Templates')
    ->with('Plugins')
    ->with('Snippets')
    ->with('Chunks')
    ->with('Tvs')
    ->get();
foreach ($categories as $category) {
    print_r($category->toArray());
}
```

You can see all currently available models with their relations in [Models](https://github.com/bezumkin/mmx-database/tree/main/core/src/Models) directory.

Do not forget to read the official [Eloquent documentation](https://laravel.com/docs/10.x/eloquent).

### Nota bene!

[](#nota-bene)

mmxDatabase models are not contain any MODX related logic, like clearing cache or calling plugin events.

This is just a convenient way to work with MODX database directly, without xPDO.

Project is still under development, do not hesitate to use [issues](https://github.com/bezumkin/mmx-database/issues) if you have any.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity47

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

Total

9

Last Release

691d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.1

1.0.2PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/022a5cefd3f21223338606065f89cf280b6d9dda930fd9f992c74b42077f70cf?d=identicon)[bezumkin](/maintainers/bezumkin)

---

Top Contributors

[![bezumkin](https://avatars.githubusercontent.com/u/1257284?v=4)](https://github.com/bezumkin "bezumkin (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mmx-database/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[dyrynda/laravel-cascade-soft-deletes

Cascading deletes for Eloquent models that implement soft deletes

1.2k3.1M5](/packages/dyrynda-laravel-cascade-soft-deletes)[tightenco/parental

A simple eloquent trait that allows relationships to be accessed through child models.

1.5k1.8M5](/packages/tightenco-parental)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)

PHPackages © 2026

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