PHPackages                             henryavila/laravel-multi-database-commands - 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. henryavila/laravel-multi-database-commands

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

henryavila/laravel-multi-database-commands
==========================================

This package provides an abstraction to efficiently manage multiple database application commands, like: migrate

v2.1.0(2y ago)382MITPHPPHP ^8.0CI failing

Since Apr 21Pushed 2y agoCompare

[ Source](https://github.com/henryavila/laravel-multi-database-commands)[ Packagist](https://packagist.org/packages/henryavila/laravel-multi-database-commands)[ Docs](https://github.com/henryavila/laravel_multi_database_commands)[ GitHub Sponsors](https://github.com/henryavila)[ RSS](/packages/henryavila-laravel-multi-database-commands/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (6)Dependencies (8)Versions (10)Used By (0)

This package provides an abstraction to efficiently run migrate command on multiple database app
================================================================================================

[](#this-package-provides-an-abstraction-to-efficiently-run-migrate-command-on-multiple-database-app)

Version 2.0 Upgrade
-------------------

[](#version-20-upgrade)

This package has been migrated from `apps-inteligentes/laravel-multi-database-commands` to `henryavila/laravel-multi-database-commands`The namespace has been moved from `AppsInteligentes\LaravelMultiDatabaseCommands` to `HenryAvila\LaravelMultiDatabaseCommands`

To update this package, update your `composer.json` file to

```
{
    "require": {
        "henryavila/laravel-multi-database-commands": "^2.0.0"
    }
}
```

If you overwrite some contente of this pacakge, make sure to run a global search a replace on your code looking for `AppsInteligentes\LaravelMultiDatabaseCommands` and replacing with `HenryAvila\LaravelMultiDatabaseCommands`

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

[](#installation)

You can install the package via composer:

```
composer require henryavila/laravel-multi-database-commands
```

You can publish the config file with:

```
php artisan vendor:publish --provider="HenryAvila\LaravelMultiDatabaseCommands\LaravelMultiDatabaseCommandsServiceProvider" --tag="laravel_multi_database_commands-config"
```

This is the contents of the published config file:

```
return [

    /*
     * Add here the list of all database connection.
     * You can find the connection names in config file: database.connections
     */
    'databases' => [

    ]
];
```

Usage
-----

[](#usage)

All new migration, created by this package will be organized this way: each database present in `multi_database_commands.databases` will have their own migration folder.

Ex: All migrations for DB `tenant` will be stored in `database/migration/tenant`. All migrate command executed by this package will isolate all DB.

### Create Migration Files

[](#create-migration-files)

To create the migration add\_active\_column\_on\_users\_table on tenant db connection, run the command:

```
php artisan multi-db:make-migration add_active_column_on_users_table tenant
```

Just like `php artisan make:migration` command, you can use the options `--create theTableToBeCreated` and `--table theTableToBeMigrated`

### Running Migrations

[](#running-migrations)

To execute a migrate command in all DB. The list of all databases, must be defined in config file `multi_database_commands`

```
# Run migration in all dbs defined in multi_database_commands config file
php artisan multi-db:migrate

# Run migration:status in all dbs defined in multi_database_commands config file
php artisan multi-db:migrate -C status

# Run migration:rollback in teannt db
php artisan multi-db:migrate tenant -C rollback

```

Just like `php artisan migrate` command, you can use all laravel variations `fresh`, `install`, `refresh`, `reset`, `rollback` and status`

To execute the command in on DB, just inform the db connection name

```
#Execute the migrate:status just on log db
php artisan multi-db:migrate log -C status
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Henry Ávila](https://github.com/henryavila)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~271 days

Total

6

Last Release

806d ago

Major Versions

1.3.0 → 2.0.02023-08-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/f05a7a5057256071ec7089d62dcf7b47d5700fe1189e7fceac681f93f2894a85?d=identicon)[henryavila](/maintainers/henryavila)

---

Top Contributors

[![henryavila](https://avatars.githubusercontent.com/u/8429941?v=4)](https://github.com/henryavila "henryavila (35 commits)")

---

Tags

laravelhenryavilalaravel\_multi\_database\_commands

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/henryavila-laravel-multi-database-commands/health.svg)

```
[![Health](https://phpackages.com/badges/henryavila-laravel-multi-database-commands/health.svg)](https://phpackages.com/packages/henryavila-laravel-multi-database-commands)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213389.8k2](/packages/wnx-laravel-backup-restore)[spatie/laravel-model-flags

Add flags to Eloquent models

4471.2M4](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

438834.4k1](/packages/clickbar-laravel-magellan)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17555.1k](/packages/lacodix-laravel-model-filter)

PHPackages © 2026

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