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

ActiveLibrary

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

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

v2.1.0(1y ago)382↓100%MITPHPPHP ^8.0

Since Apr 21Pushed 1y 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 today

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

31

—

LowBetter than 70% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

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

711d 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

[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13662.4k1](/packages/ralphjsmit-laravel-helpers)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

136.9k1](/packages/basillangevin-laravel-data-json-schemas)

PHPackages © 2026

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