PHPackages                             mage/db2 - 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. mage/db2

ActiveMagento2-module[Database &amp; ORM](/categories/database)

mage/db2
========

Magento 2 module to load Laravel Eloquent with Magento

1.0.8(1y ago)110812PHP

Since Nov 28Pushed 1y ago2 watchersCompare

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

READMEChangelog (7)Dependencies (5)Versions (6)Used By (2)

install
=======

[](#install)

```
composer require mage/db2

```

If you have any conflicts, you can use:

```
composer require mage/db2 --with-all-dependencies --ignore-platform-reqs --prefer-source --no-scripts

```

use Mage\\DB2\\DB2;

$isReturningCustomer = DB2::table('sales\_order') -&gt;where('customer\_id', $customerId) -&gt;where('entity\_id', '&lt;', $entityId) -&gt;exists();

```

```

DB2::table('sales\_order')-&gt;where('customer\_id', 123)-&gt;get();

```

Query product images with product details using DB2:

```

```
        $images = DB2::table('catalog_product_entity_media_gallery as main_table')
            ->join(
                'catalog_product_entity_media_gallery_value as mgv',
                'mgv.value_id',
                '=',
                'main_table.value_id'
            )
            ->join(
                'catalog_product_entity as e',
                'e.entity_id',
                '=',
                'mgv.entity_id'
            )
            ->select([
                'main_table.value_id',
                'main_table.attribute_id',
                'main_table.value',
                'main_table.media_type',
                'main_table.disabled',
                'e.sku'
            ])
            ->where('main_table.media_type', '=', 'image')
            ->where('main_table.disabled', '=', 0)
            ->orderBy('main_table.value_id', 'ASC')
            ->get();

```

```

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance43

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.5% 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 ~5 days

Total

5

Last Release

514d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2614da2cb514a3749cd296d237c9ca3430f4dafa09b4e49e338a6b1794a5acf4?d=identicon)[genaker](/maintainers/genaker)

---

Top Contributors

[![wseng](https://avatars.githubusercontent.com/u/6572161?v=4)](https://github.com/wseng "wseng (6 commits)")[![Genaker](https://avatars.githubusercontent.com/u/9213670?v=4)](https://github.com/Genaker "Genaker (5 commits)")

### Embed Badge

![Health badge](/badges/mage-db2/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[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)
