Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Multi Database Commands Laravel Package

henryavila/laravel-multi-database-commands

A Laravel package that adds Artisan commands for working with multiple database connections, letting you run migrations, seeders, rollbacks, and related database tasks across all configured connections from one command.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Package scope. henryavila/laravel-multi-database-commands is a thin Artisan extension that lets migration/seed/database commands fan out across a set of configured connections rather than requiring a --database= flag per invocation. The value proposition is operational convenience, not novel data-layer capability: it wraps Laravel's native command classes and loops over a connection list.

Architecture fit. Low-coupling by design — it sits at the console layer, which is the least invasive place in a Laravel application to add behavior. It does not alter the query builder, Eloquent, or connection resolution, so it carries little risk of contaminating application code. Fit is strong for teams already running multi-tenant, multi-region, or shard-per-database topologies where the same migration set must be applied to N connections. It is a poor fit for heterogeneous schemas where connections intentionally diverge — the command model assumes uniform intent.

What v2.1.0 changes. Single-item release: Laravel 11 support (PR #8). Versioned as a minor bump off v2.0.0, which is the correct signal — additive framework compatibility, no declared breaking changes. For a package whose entire surface is command registration against framework internals, a Laravel major is genuinely load-bearing, so this is a meaningful release rather than a routine bump. Concrete implications to verify: the package's composer.json constraint (does it now read ^10.0|^11.0 or ^11.0 only — the latter would silently drop existing installs on composer update), service-provider registration under Laravel 11's slimmer application skeleton, and whether commands still resolve cleanly given Laravel 11's changes to console kernel bootstrapping and config publishing conventions.

Technical risk. Moderate-low, concentrated in three places. (1) Maintainer concentration — a single-author package with an infrequent release cadence; Laravel 11 support arriving after the framework's release is the expected lag, but it confirms the project tracks upstream reactively, not proactively. (2) Internal API coupling — command wrappers that extend or delegate to Illuminate\Database\Console\Migrations\MigrateCommand inherit fragility across Laravel majors; the fact that Laravel 11 required a code change (rather than being a no-op) confirms this coupling is live. (3) Blast radius — the commands mutate schema across every configured connection, so a defect surfaces as a partially-migrated production fleet, not a failed request.

Key questions.

  • What is the exact illuminate/* / php constraint in v2.1.0, and does it retain ^10.0?
  • Does v2.1.0 drop support for Laravel 8/9, and if so is that documented as a breaking change despite the minor version?
  • Are commands still auto-discovered, or does Laravel 11 require manual registration?
  • Does the package honor per-connection migrations table paths and migrationRepository overrides, or does it assume defaults?
  • Is there a --force/production-guard passthrough, and does it propagate correctly to each connection?
  • What is the CI matrix — is Laravel 11 actually tested, or only declared in constraints?

Integration Approach

Stack fit. Target environment is Laravel 11 (new capability) with a fallback posture for existing Laravel 10 services. Before adoption, resolve the version constraint question above: a ^11.0-only constraint means this is an upgrade-coupled dependency and must ride the framework upgrade train rather than being adopted independently. That distinction drives everything downstream.

Migration path. Low-effort, because the package is additive. Typical pre-adoption state is hand-rolled shell loops or CI steps invoking php artisan migrate --database=tenant_a, --database=tenant_b, and so on. Replacement is mechanical: publish config (if applicable), enumerate connections, collapse the loop to one command. No schema changes, no data migration, no application code changes. Recommend running the package's commands and the existing scripts side by side in staging and diffing migrations table contents per connection to confirm identical outcomes before cutting over.

Compatibility. Three axes to pin explicitly in the ADR:

  • Framework: Laravel 11 confirmed by release; Laravel 10 presumed retained — verify.
  • PHP: Laravel 11 requires PHP 8.2+, which may itself be the binding constraint independent of this package.
  • Database drivers: connection-per-tenant patterns frequently mix drivers (MySQL primary, Postgres analytics). Confirm the package does not assume a single grammar when computing migration state.

Sequencing.

  1. Land the Laravel 10 → 11 framework upgrade first, with the package absent. Isolate framework risk from package risk.
  2. Add the package pinned to the exact v2.1.0 tag in a non-production environment; confirm command discovery and --help output.
  3. Exercise against a throwaway connection set with intentionally divergent migration states to observe failure behavior (see below).
  4. Roll to production behind the standard migrate window; keep existing scripts in the runbook for one release cycle as fallback.

Operational Impact

Maintenance. The package is small enough to vendor or fork if the maintainer goes dormant — a genuine mitigation, and worth stating explicitly as the reason the bus-factor risk is tolerable. Budget a recurring line item for reviewing this dependency at each Laravel major; the Laravel 11 lag demonstrates the package will not be ready on day one of future framework releases. Pin the version; do not float on ^2.0, since a future minor could narrow framework constraints.

Support. No commercial backing. Support is GitHub issues at maintainer discretion. Internal ownership should be assigned to the platform/DevOps group that owns the migration pipeline, not to application teams — the blast radius is fleet-wide, and the command semantics are infrastructure concerns.

Scaling. Execution is serial per connection by design; wall-clock time grows linearly with tenant count. For fleets in the hundreds this becomes the dominant cost of a deploy, and it is the most likely trigger for eventually replacing the package with a parallelized, queue-driven migration orchestrator. Note also that connection-count growth is a config-file concern here rather than a discovery concern — new tenants require config edits plus a deploy, which is a real friction point for dynamically provisioned tenants.

Failure modes. The important ones are silent and partial:

  • Mid-loop failure — connection 3 of 8 fails; connections 1–2 are migrated, 4–8 are not, and the fleet is now on mixed schema versions. Application code deployed against the new schema will break on the un-migrated tenants. This is the primary operational hazard and demands an explicit rollback/retry story per connection rather than a single pipeline step.
  • Exit-code masking — if the wrapper swallows non-zero returns from individual connection runs, CI reports green on a partial failure. Verify exit-code propagation before trusting it in a gate.
  • No cross-connection atomicity — inherently impossible; do not design a deploy that assumes all-or-nothing.
  • Long-running locks — serial execution means the migration window widens with tenant count, increasing contention with live traffic on early connections while later ones wait.
  • Divergent migration state — pre-existing drift between connections will surface as confusing failures on first adoption; baseline the fleet before rollout.
  • Laravel 11 edge cases — untested code paths under the new console bootstrapping are the specific risk this release introduces; the migrate path is likely covered, less-common commands (seed, fresh, rollback, reset) may not be.

Ramp-up. Trivial for anyone fluent in Artisan — effectively zero new mental model, which is the package's main virtue and its main argument over a bespoke script. The non-trivial part is not the tool but the runbook: per-connection failure handling, verification queries, and the decision rule for aborting versus continuing a partially-applied fleet migration. Allocate the ramp-up budget there, and treat the package itself as a one-afternoon onboarding.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast