signifly/laravel-database-refactors
A Laravel package for organising database refactors as trackable, repeatable classes separate from migrations. Run schema and data refactors safely, keep a history of applied refactors, and roll changes out consistently across environments.
Architecture fit. signifly/laravel-database-refactors follows standard Laravel package conventions: a service provider with auto-discovery, a publishable config file, a migration that creates a refactors bookkeeping table, and an artisan generator (make:refactor) that stubs classes with a handle() method. It formalizes a pattern most Laravel teams improvise — tracked, repeatable one-off data transformations kept out of schema migrations. That separation is architecturally sound and pairs cleanly with a migrate --force deploy step. Footprint is small and non-invasive; it does not touch the query builder, Eloquent, or the container in unusual ways.
Integration feasibility. Mechanically trivial: one composer require, one publish, one migrate. The real constraint is version alignment. Last release was May 2021 (Laravel 8 era, PHP 7.4/8.0), the package is archived, and there are zero dependents — meaning nobody is exercising it against Laravel 9/10/11 or PHP 8.2/8.3. Expect the illuminate/support constraint to block installation outright on a modern stack, before any runtime behavior is even tested. Auto-discovery, config merging, and the stub generator are the most likely breakpoints; the runtime logic itself is simple enough that it probably survives.
Technical risk. High, and concentrated in abandonment rather than design. No security patching, no PHP minor-version fixes, no upstream response to issues. Single-maintainer agency package with an archive flag is a de facto end-of-life notice. Secondary risks: the tracking table is the only guard against double-execution, so any manual intervention or failed transaction can desynchronize recorded state from actual data state; and stubs generated by an old package may encode conventions (namespace layout, Refactor base class contracts) your team has since moved past.
Key questions.
composer require even resolve? Test this first — it is a 15-minute answer that gates everything else.handle() suffice?Stack fit. Strong if you are Laravel + MySQL/Postgres with a standard migrate --force deploy. The pattern is directly applicable to backfills, enum/data reshaping, and denormalization cleanup — the exact work that otherwise pollutes the migrations folder and accumulates forever. It fits poorly if you are on multi-tenant or sharded databases where the refactor must fan out per-tenant.
Migration path. Three tiers, in order of preference:
refactor:run command in-house. This is a day of work, removes the dependency entirely, and is the recommendation given the archive status and the low score.Compatibility. Verify in this order: composer constraint resolution, service provider auto-discovery, config publish tag, migration stub rendering, and a full round-trip (make:refactor → run → verify tracking row → re-run to confirm no-op). Also confirm the refactors table name and schema do not collide with anything existing.
Sequencing. (1) Timeboxed spike in a throwaway branch with your real composer.json — confirm installability. (2) If blocked, decide fork vs. in-house immediately; do not spend time patching a fork you have not committed to owning. (3) Build the compat matrix against your current and next Laravel version. (4) Add the refactor step to the deploy runbook and CI smoke test. (5) Publish team conventions: naming, idempotency expectations, chunk size, rollback story.
Maintenance. As-is: unbounded and unowned risk. Forked or in-house: roughly 2–4 days per year, mostly dependency bumps and Laravel major-version compatibility. Budget the initial internalization at 1–2 engineer-days including tests.
Support. No upstream support channel of any practical value. You need a named internal owner and a documented decision record explaining why the pattern exists, or the next team will either misuse it or rip it out.
Scaling. Refactors execute synchronously, which is fine for small backfills and dangerous for large tables — a long-running handle() inside a deploy step will stall the release and can hold locks. Enforce chunked iteration (chunkById, not chunk), cap transaction scope, and require a documented runtime estimate for anything touching a table above ~1M rows. Consider running large refactors out-of-band via a queue or a one-off task rather than the deploy pipeline.
Failure modes.
Ramp-up. Low for any Laravel developer — the generator and command surface are self-explanatory within an hour. The non-obvious learning is discipline: writing idempotent handlers, chunking, and knowing when a refactor belongs in a migration instead. Codify that in a short README addition rather than relying on tribal knowledge.
Bottom line. The idea is worth keeping; the package is not. Adopt the pattern, vendor the implementation, and avoid taking a dependency on an archived 24-star package with no dependents and a 2021 release date.
How can I help you explore Laravel packages today?