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 Conditional Migrations Laravel Package

mll-lab/laravel-conditional-migrations

Laravel Conditional Migrations adds condition-based execution to your database migrations, letting you run or skip specific migration files when predefined criteria are met. Ideal for environment-specific schema changes, feature rollouts, and safer deployments.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The capability is a genuinely useful one: attaching conditions to migrations so environment-specific or optional schema changes (feature-gated columns, staging-only indexes, tenant-specific tables) can run through the standard php artisan migrate / migrate:rollback lifecycle instead of bespoke Artisan commands or manual DBA steps. To deliver that, the package must hook Laravel's migrator internals and the migrate/rollback command lifecycle — a high-coupling surface that changes between Laravel minors and patches.

That coupling is exactly why the deprecation matters. The repo is archived, last released 2023-02-10, has 1 star and 0 dependents, and states it is superseded by mll-lab/laravel-utils v4.0.0. Whatever architectural merit the design had, there is no maintained implementation here. Fit with a modern Laravel application is effectively no; fit is limited to legacy Laravel 9.x estates that already have it in a lockfile.

Integration feasibility. Low for a new adoption. Installing an archived package means accepting a frozen compatibility envelope (Laravel 9.x, with 9.21 explicitly unsupported) and no path to Laravel 10/11. Composer will increasingly refuse resolution as the host framework advances. The realistic integration options are: (a) adopt the successor package, (b) implement a small first-party equivalent, or (c) do not adopt the capability at all and use environment-scoped migration paths instead.

Technical risk. High, on three independent axes:

  • Sustainability risk. Archived + 0 dependents + 1 star means near-zero field validation. There is no community to surface edge cases, no security response, and no maintainer obligation. Any defect becomes yours.
  • Semantic risk. Conditional migrations make schema state a function of environment and runtime config. That is powerful and also a governance hazard: production and staging can legitimately diverge, and "is this migration applied?" stops being answerable from the migrations table alone. This risk is inherent to the pattern, not just to this implementation — it should shape whether you adopt the capability at all, before you choose a package.
  • Compatibility risk. The v3.1.1 note — "Mark Laravel 9.21 as unsupported" — shows patch-level version management, a strong signal of reliance on framework internals. Adjacent patches are untested territory.

Key questions.

  • Does mll-lab/laravel-utils v4.0.0 actually carry the conditional-migration capability forward, or was the feature dropped rather than relocated? Confirm before treating the successor as a drop-in.
  • If it was carried forward, what is the API delta (base class, trait, method signature) and is there a migration guide?
  • How does the package record skipped migrations — are they written to the migrations table, and can a condition that later becomes true retroactively apply a previously skipped migration?
  • How do conditions interact with migrate:fresh, migrate:refresh, migrate:rollback --step, schema dumps/squash, and parallel test execution?
  • Is the Laravel 9.21 exclusion enforced via a composer.json conflict entry or documented only?
  • Which teams, if any, currently depend on this package (check lockfiles across services, not Packagist dependents — private usage is invisible in the 0-dependents figure)?

Integration Approach

Stack fit. Legacy only: Laravel 9.x, excluding 9.21, already resolved in a composer.lock. There is no supported path onto Laravel 10/11, so any service on a supported-Laravel roadmap should not take this dependency.

Migration path. Recommend two tracks depending on the audit result:

  1. Already using it. Treat this as a technical-debt item with a named owner and an exit date. Move to laravel-utils v4.0.0 if the capability survives there; otherwise extract the conditional logic into a thin first-party base migration class you control (~100–200 LOC, testable, no external bus factor). Either way, the end state is "no dependency on an archived repo."
  2. Considering it. Do not adopt. Evaluate the successor directly, or implement environment-scoped migration directories (--path=database/migrations/{env}) which solve the most common use case with zero custom code and no schema ambiguity.

Compatibility. Pin Laravel and the package in composer.lock and assert the Laravel patch version in CI, not just the minor. Document the 9.21 exclusion with its root cause, or future maintainers will re-litigate it.

Sequencing.

  1. Inventory actual usage: grep composer.json/composer.lock across all services; the 0-dependents figure tells you nothing about internal blast radius.
  2. Classify each conditional migration by reason (environment gating, optional feature, tenant variance). Many will turn out to be solvable with migration paths or config flags, shrinking the migration surface.
  3. Evaluate laravel-utils v4.0.0 against that reduced surface; verify the capability and API.
  4. Pilot on one non-critical service; run the package's test suite plus your own conditional-migration cases against the exact target Laravel patch.
  5. Roll out with a CI gate that fails on drift into unsupported Laravel patches, then decommission the old dependency.

Operational Impact

Maintenance. Upstream maintenance is zero — the repo is archived and will not be updated. The real maintenance burden is the fork-or-replace decision plus the ongoing cost of the pattern: every conditional migration is a branch in your schema truth that someone must reason about during incidents, onboarding, and audits. Budget for dependency review, not just a one-time integration.

Support. No vendor, no community, no issue triage. Internal ownership is mandatory: a named team accountable for the base migration class and for answering "why is this migration skipped in prod?" during an incident. Without that, the first schema-drift incident will consume more engineering time than the package ever saved.

Scaling. No runtime scaling implications — this is build/deploy-time tooling. The scaling cost is organizational and in CI: each supported Laravel patch multiplies test matrix combinations, and each additional conditional migration multiplies the number of distinct schema states that QA and support must consider.

Failure modes.

  • Composer resolution failure blocking a Laravel upgrade, and by extension security patching.
  • Silent schema divergence between environments, discovered only via a production error.
  • Asymmetric rollback: conditions evaluated at up time may not mirror cleanly at down time.
  • Permanently skipped migrations that a later condition change should have applied — a "stuck" schema state with no obvious signal.
  • Abandonment risk: archived repos remain readable and Packagist generally continues serving them, but a yanked version or a PHP/Laravel incompatibility has no fix path.
  • False confidence in CI when only the minor Laravel version is pinned.

Ramp-up. Low technically — any Laravel developer reads the API in minutes. The real ramp-up is conceptual and governance-oriented: engineers must internalize that conditional migrations mean the schema is environment-dependent, that this is a deliberate exception to Laravel's "migrations are the single source of schema truth" doctrine, and that the exception needs review. Document the pattern, its approved use cases, and an explicit ban list (e.g., never conditionally create auth/payment tables). If the team cannot articulate those boundaries, the capability should not be introduced.


Basis: deprecation notice, package description, and the v3.1.1 release note. Confidence is low on whether the successor retains this capability, the enforcement mechanism for the 9.21 exclusion, and internal usage. Validate those three points before making any build-or-buy decision — they determine whether the migration path exists at all.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource