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.
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:
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.Key questions.
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.migrations table, and can a condition that later becomes true retroactively apply a previously skipped migration?migrate:fresh, migrate:refresh, migrate:rollback --step, schema dumps/squash, and parallel test execution?composer.json conflict entry or documented only?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:
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."--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.
composer.json/composer.lock across all services; the 0-dependents figure tells you nothing about internal blast radius.laravel-utils v4.0.0 against that reduced surface; verify the capability and API.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.
up time may not mirror cleanly at down time.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.
How can I help you explore Laravel packages today?