PHPackages                             agelxnash/modx-evo-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. agelxnash/modx-evo-database

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

agelxnash/modx-evo-database
===========================

1.5.0(5y ago)21.2k2[1 issues](https://github.com/AgelxNash/modx-evo-database/issues)[1 PRs](https://github.com/AgelxNash/modx-evo-database/pulls)1MITPHPPHP &gt;=5.6

Since Jun 1Pushed 5y agoCompare

[ Source](https://github.com/AgelxNash/modx-evo-database)[ Packagist](https://packagist.org/packages/agelxnash/modx-evo-database)[ RSS](/packages/agelxnash-modx-evo-database/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (16)Used By (1)

DBAPI Evolution
---------------

[](#dbapi-evolution)

[![CMS MODX Evolution](https://camo.githubusercontent.com/c4607ff5e1784038c4ff7d95307e6d51ccb806c1a2554a8b70778ac51b4f4911/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f434d532d4d4f445825323045766f6c7574696f6e2d627269676874677265656e2e737667)](https://github.com/modxcms/evolution) [![Build Status](https://camo.githubusercontent.com/3881c06a5981b27fc98b7ac8bbda2f1672eb713b8611cc00d173b0610946a1c2/68747470733a2f2f6170692e7472617669732d63692e6f72672f4167656c784e6173682f6d6f64782d65766f2d64617461626173652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AgelxNash/modx-evo-database) [![StyleCI](https://camo.githubusercontent.com/73493f5028fc5ae8a27237aecf083ead9732c208d1bf9236152c5656078f0a53/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133353731353538322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/135715582) [![Code quality](https://camo.githubusercontent.com/065e4ee9fdc6ff4209a86f0a5aefdc509b1d1d815e0c7e877929e2181f483f74/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4167656c784e6173682f6d6f64782d65766f2d64617461626173652e7376673f6d61784167653d32353932303030)](https://scrutinizer-ci.com/g/AgelxNash/modx-evo-database/) [![Code Coverage](https://camo.githubusercontent.com/2c2ab3c87e49a4a483a123f64209f5959367f6e0dc6748c8afba1eebb28dbee0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4167656c784e6173682f6d6f64782d65766f2d64617461626173652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/AgelxNash/modx-evo-database/?branch=master) [![Total Downloads](https://camo.githubusercontent.com/de6976f1eb74b0b52b9044aca3c2a9918379daeaaf0891df34439f7fea0e8da9/68747470733a2f2f706f7365722e707567782e6f72672f6167656c786e6173682f6d6f64782d65766f2d64617461626173652f642f746f74616c2e706e67)](https://packagist.org/packages/agelxnash/modx-evo-database) [![License](https://camo.githubusercontent.com/07e036c7ac38a139a6c7d2b7db3324d10f44ccbcffb896d08b70989d9219f630/68747470733a2f2f6769746c6963656e73652e636f6d2f62616467652f4167656c784e6173682f6d6f64782d65766f2d6461746162617365)](https://github.com/AgelxNash/modx-evo-database/blob/master/LICENSE.md)

### Example

[](#example)

---

#### MySQLi

[](#mysqli)

```
$DB = new AgelxNash\Modx\Evo\Database\Database([
    'host' => 'localhost',
    'database' => 'modx',
    'username' => 'homestead',
    'password' => 'secret',
    'prefix' => 'modx_',
    'charset' => 'utf8mb4',
    'method' => 'SET NAMES',
    'collation' => 'utf8mb4_unicode_ci',
]);
$DB->setDebug(true);
$DB->connect();
$table = $DB->getFullTableName('site_content');

$result = $DB->query('SELECT * FROM ' . $table . ' WHERE parent = 0 ORDER BY pagetitle DESC LIMIT 10');
    // or
$result = $DB->select('*', $table, 'parent = 0', 'pagetitle DESC', '10');
    // or
$result = $DB->select(
        ['id', 'pagetitle', 'title' => 'longtitle'],
        ['c' => $table],
        ['parent = 0'],
        'ORDER BY pagetitle DESC',
        'LIMIT 10'
    );
foreach ($DB->makeArray($result) as $item) {
    echo "\t [ DOCUMENT #ID " . $item['id'] . ' ] ' . $item['pagetitle'] . PHP_EOL;
}
```

#### Illuminate\\Database and Eloquent

[](#illuminatedatabase-and-eloquent)

`composer require "illuminate/database"` required when you need to use **IlluminateDriver**`composer require "illuminate/events"` required when you need to use observers with Eloquent

```
$DB = new AgelxNash\Modx\Evo\Database\Database(
    [
        'host' => 'localhost',
        'database' => 'modx',
        'username' => 'homestead',
        'password' => 'secret',
        'prefix' => 'modx_',
        'charset' => 'utf8mb4',
        'method' => 'SET NAMES',
        'collation' => 'utf8mb4_unicode_ci',
    ],
    AgelxNash\Modx\Evo\Database\Drivers\IlluminateDriver::class
);
$DB->connect();

$table = $DB->getFullTableName('site_content');
$result = $DB->query('SELECT * FROM ' . $table . ' WHERE parent = 0 ORDER BY pagetitle DESC LIMIT 10');
foreach ($DB->makeArray($result) as $item) {
    echo "\t [ DOCUMENT #ID " . $item['id'] . ' ] ' . $item['pagetitle'] . PHP_EOL;
}

$results = Illuminate\Database\Capsule\Manager::table('site_content')
    ->where('parent', '=', 0)
    ->orderBy('pagetitle', 'DESC')
    ->limit(10)
    ->get();
foreach ($results as $item) {
    echo "\t [ DOCUMENT #ID " . $item->id . ' ] ' . $item->pagetitle . PHP_EOL;
}

$results = AgelxNash\Modx\Evo\Database\Models\SiteContent::where('parent', '=', 0)
    ->orderBy('pagetitle', 'DESC')
    ->limit(10)
    ->get();
foreach ($results as $item) {
    echo "\t [ DOCUMENT #ID " . $item->id . ' ] ' . $item->pagetitle . PHP_EOL;
}

// create table
Illuminate\Database\Capsule\Manager::schema()->create('users', function ($table) {
    $table->increments('id');
    $table->string('email')->unique();
    $table->timestamps();
});
```

Read more about

- [Illuminate\\Database](https://laravel.com/docs/5.6/database)
- [Eloquent](https://laravel.com/docs/5.6/eloquent)

### Author

[](#author)

---

  [![](https://camo.githubusercontent.com/09a23f995538d8eeed9b467fb6f7c894998e6df98f8d322e5a16d6419f3282d2/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f62663132643434313832633938323838303135663635633938363139303361613f733d323530)](https://camo.githubusercontent.com/09a23f995538d8eeed9b467fb6f7c894998e6df98f8d322e5a16d6419f3282d2/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f62663132643434313832633938323838303135663635633938363139303361613f733d323530) #### Borisov Evgeniy
 Agel\_Nash

[](#borisov-evgeniyagel_nash)

 Laravel, MODX, Security Audit

 **Telegram**: [@agel\_nash](https://t.me/Agel_Nash)
 **Email**: modx@agel-nash.ru

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 95.9% 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 ~65 days

Recently: every ~224 days

Total

15

Last Release

1934d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.3.2PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6eeb152aa8a6a81b05883f09f583f4fafbc50935495d79a2d8a01e0e5f9aa6?d=identicon)[Agel Nash](/maintainers/Agel%20Nash)

---

Top Contributors

[![AgelxNash](https://avatars.githubusercontent.com/u/1748872?v=4)](https://github.com/AgelxNash "AgelxNash (47 commits)")[![Pathologic](https://avatars.githubusercontent.com/u/3012304?v=4)](https://github.com/Pathologic "Pathologic (1 commits)")[![Ser1ous](https://avatars.githubusercontent.com/u/4497968?v=4)](https://github.com/Ser1ous "Ser1ous (1 commits)")

---

Tags

databasemodxmysqli

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agelxnash-modx-evo-database/health.svg)

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

###  Alternatives

[sergeytsalkov/meekrodb

The Simple PHP/MySQL Library

341379.8k9](/packages/sergeytsalkov-meekrodb)[go/db

Database library

6624.1k](/packages/go-db)[krugozor/database

PHP class library for simple, convenient, fast and safe work with MySql database, using PHP mysqli extension and imitation of prepared queries.

392.5k](/packages/krugozor-database)

PHPackages © 2026

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