PHPackages                             noweh/eloquent-dual-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. noweh/eloquent-dual-database

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

noweh/eloquent-dual-database
============================

Custom Eloquent Builder for dual database.

1.0.1(4y ago)36MITPHPPHP &gt;=7.4

Since Dec 2Pushed 4y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

DualDB plugin for Eloquent models
=================================

[](#dualdb-plugin-for-eloquent-models)

[![Laravel](https://camo.githubusercontent.com/114acbc1a6584cde835a46b115105790c6d2ca644b0721be7e1dde9ef1659b52/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d76362f382d3832386362372e7376673f6c6f676f3d4c61726176656c26636f6c6f723d464632443230)](https://laravel.com/)[![MIT Licensed](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](licence.md)

This package provides a trait that override the Eloquent Builder in order to improve the management of Dual DB, with one DB for **Read** and Another for **Write**.

Indeed, this plugin allows you to retrieve freshly inserted data, even if the have not yet been duplicated on the Read Database.

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

[](#installation)

First you need to add the component to your composer.json

```
composer require noweh/laravel-plugin-dual-database

```

Update your packages with *composer update* or install with *composer install*.

Simple Usage
------------

[](#simple-usage)

Use the trait `Noweh\EloquentDualDatabase\EloquentDualDatabaseTrait` in your Model.

### Example

[](#example)

```
use Noweh\EloquentDualDatabase\EloquentDualDatabaseTrait;

class MyModel extends Model
{
    use EloquentDualDatabaseTrait;

    ...
}

```

Or, for a custom usage
----------------------

[](#or-for-a-custom-usage)

Override the Eloquent Method `newEloquentBuilder($query)` in your Model.

### Example

[](#example-1)

```
use Noweh\EloquentDualDatabase\CustomEloquentBuilder;

class MyModel extends Model
{
    public function newEloquentBuilder($query): Builder
    {
        ...
        return new CustomEloquentBuilder($query);
    }

    ...
}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Total

2

Last Release

1619d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11422029?v=4)[Julien SCHMITT](/maintainers/Noweh)[@noweh](https://github.com/noweh)

---

Top Contributors

[![noweh](https://avatars.githubusercontent.com/u/11422029?v=4)](https://github.com/noweh "noweh (3 commits)")

---

Tags

eloquentlaravellaraveleloquent

### Embed Badge

![Health badge](/badges/noweh-eloquent-dual-database/health.svg)

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

###  Alternatives

[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M251](/packages/cviebrock-eloquent-sluggable)[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M46](/packages/watson-validating)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)

PHPackages © 2026

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