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 Database Refactors Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  1. What are our exact Laravel and PHP version ceilings, and does a composer require even resolve? Test this first — it is a 15-minute answer that gates everything else.
  2. Do we need dry-run, transactional wrapping, environment guards, and batch chunking — or does the package's bare handle() suffice?
  3. Is the deploy pipeline the right execution trigger, or do we need an operator-invoked command with approval?
  4. Who owns the fork if we internalize, and what is the review cadence?
  5. Is the pattern worth a dependency at all, versus ~150 lines of in-house command plus a table?

Integration Approach

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:

  1. Vendor the pattern. Reimplement the tracking table, base class, generator, and 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.
  2. Fork and internalize. If the existing code is a better starting point than a blank file, fork under an internal namespace, pin to your Laravel version, and treat it as first-party code.
  3. Consume as-is. Only defensible on Laravel 8/PHP 8.0 with a hard freeze, and even then you are absorbing unpatched risk for negligible gain.

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.

Operational Impact

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.

  • Partial application: a mid-run exception leaves data half-transformed and the tracking row absent; re-run must be safe. Idempotency is the team's responsibility, not the package's.
  • Double execution: manual DB intervention or a restored snapshot desynchronizes the tracking table from reality.
  • Deploy blocking: a slow or hung refactor fails the release and, depending on pipeline design, may leave the app on new code with old data.
  • Environment drift: refactors run against staging but are skipped in production (or vice versa) because the tracking table was copied between environments.
  • Wrong target: no built-in environment guard means a production connection plus a stray local invocation is a live data mutation.

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.

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