rappasoft/laravel-patches
rappasoft/laravel-patches offers a curated set of patch files for the Laravel framework, packaged for Composer's patch plugin. Apply targeted core fixes and small behavior tweaks without forking Laravel, handy for temporary workarounds until upstream changes land.
down() now halts rollback, rethrows the original exception, and keeps the execution record, so a half-rolled-back batch can no longer be silently reported as clean. That makes rollback state an auditable, trustworthy signal — which is what turns this from "convenience wrapper" into something you can put in a production change process.patches/ directory, writes rows to a patches table, and supports down(). That's a few days of build plus indefinite ownership of rollback semantics, concurrency edge cases, and framework-version churn. Buying (adopting) is defensible purely on the cost of getting the rollback-failure semantics right — v4.1.0 shows that detail is subtle enough to have shipped wrong previously.Adopt when:
stop_on_error / always-stop-on-rollback-failure split is a reasonable default and now behaves predictably.Look elsewhere or wait when:
down(). It won't: preserving the execution record is bookkeeping, not compensation. If your patches aren't wrapped in transactions, you still own inconsistent-state recovery. If your team won't reliably write transactional down() methods, this package reduces but does not remove rollback risk.To executives (one paragraph): We're evaluating a small Laravel package that makes production data changes auditable, ordered, and reversible using the same discipline we already apply to database migrations. The latest release adds support for the newest Laravel version and, more importantly, fixes a real safety gap: when a rollback fails, the system now stops and records the truth instead of reporting a false success. That directly reduces the risk and recovery time of the data fixes we ship — the kind of change that otherwise becomes a late-night manual SQL exercise. Cost is a small dependency and a process convention, not a build project; the alternative is an in-house tool we'd own forever. The main caveat is a platform dependency: full benefit assumes we're on a security-supported Laravel version and PHP 8.3+, so this ties into the upgrade work already on the roadmap.
To engineering (short): Single-purpose package for running ordered, recorded, reversible data patches — migrations semantics applied to data. v4.1.0 adds Laravel 13 support (PHP 8.3+ there; 8.2 still fine on 11/12), and fixes rollback failure handling: down() throwing now halts rollback, rethrows the original exception, and retains the patch execution record; completion/failure events carry the original batch. No new migrations when upgrading from 4.0.x. Two things we must own: (1) rollback does not compensate partial DB changes — wrap patches in transactions where that matters; (2) correct any failed rollback before retrying. Coverage is credible (154 tests / 403 assertions, matrix run on the tag, clean audits on 12/13). Proposed pilot: adopt for one non-critical backfill, codify the transaction and failed-rollback runbook, then make it the default path for production data fixes.
How can I help you explore Laravel packages today?