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

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

elysiumrealms/database-router
=============================

A Database Router isolate Read Write Connections

1.0.1(2y ago)0852MITPHPPHP \*

Since May 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/elysiumrealms/database-router)[ Packagist](https://packagist.org/packages/elysiumrealms/database-router)[ RSS](/packages/elysiumrealms-database-router/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

Database Router
===============

[](#database-router)

Description
-----------

[](#description)

Database Router is an extension for databases using master-slave architecture. This extension ensures that the default connection uses a read-write capable database host and extends an optional router connection to partially apply read-write isolation strategies based on business logic.

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

[](#installation)

1. Install `elysiumrealms/database-router`.

    ```
    composer require elysiumrealms/database-router
    ```
2. Configure `config/database.php` and `config/app.php`.

    ```
    php artisan db:router:install
    ```

Read from `DB_READ_HOST`
------------------------

[](#read-from-db_read_host)

To perform read operations using the read host, you can use the following methods:

```
$model = Model::router()->first();
```

```
$model = Admin::where('id', 1)->router()->first();
```

```
$model = Admin::router()->where('id', 1)->first();
```

```
DB::table('users')->router()->find(1);
```

Update with `DB_WRITE_HOST`
---------------------------

[](#update-with-db_write_host)

To perform update operations using the write host, you can use the following methods:

```
$model = Model::router()
    ->update(['name' => 'new-name']);
```

```
$model = Admin::where('id', 1)->router()
    ->update(['name' => 'new-name']);
```

```
$model = Admin::router()->where('id', 1)
    ->update(['name' => 'new-name']);
```

```
DB::table('users')->router()
    ->update(['name' => 'new-name']);
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~21 days

Total

2

Last Release

754d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1531222?v=4)[deflinhec](/maintainers/deflinhec)[@deflinhec](https://github.com/deflinhec)

---

Top Contributors

[![danny-eliterds](https://avatars.githubusercontent.com/u/178126400?v=4)](https://github.com/danny-eliterds "danny-eliterds (3 commits)")[![deflinhec](https://avatars.githubusercontent.com/u/1531222?v=4)](https://github.com/deflinhec "deflinhec (1 commits)")

---

Tags

databaselaravellaravel-packagemaster-slavelaravelrouterdatabasemaster-slave

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[waad/laravel-model-metadata

A robust Laravel package for handling metadata with JSON casting, custom relation names, and advanced querying capabilities.

854.6k](/packages/waad-laravel-model-metadata)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3535.8k3](/packages/wayofdev-laravel-cycle-orm-adapter)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

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