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.
Package: rappasoft/laravel-patches — a Laravel package for running ordered, versioned data patches (a migrations-style ledger for one-off data/state changes rather than schema changes).
Architecture fit. The package sits alongside Laravel's native migrator and follows the same conventions: a repository table for execution history, an artisan-driven runner, up()/down() contracts, and framework events for observability. That symmetry is the main architectural argument for adoption — it introduces a second ledger but no second mental model. Teams already comfortable with php artisan migrate and migrate:rollback inherit the operational semantics with minimal translation. v4.1.0 does not alter that core shape; it hardens the failure path and widens the framework support envelope.
Integration feasibility. High for any Laravel 11/12/13 application on PHP 8.2+ (8.3+ required for Laravel 13). The upgrade from 4.0.x is explicitly migration-free — no new migrations are introduced — so this is a Composer version bump plus behavioral verification. The documented installation paths now cover both existing migration sets and the v3 → v4 upgrade, which lowers the cost of adopting from older releases. The significant integration work is not installation but policy: deciding how patch rollback is expected to behave in non-production environments, and confirming that existing runbooks, CI jobs, and on-call documentation match the new failure semantics.
Technical risk. The dominant risk in this release is a deliberate behavioral change, not a defect. Previously, a patch whose down() threw could be reported as rolled back and have its execution record discarded — a silent divergence between the ledger and reality. v4.1.0 now stops the rollback, rethrows the original exception, and preserves the execution record. Consequences a TPM must plan for:
down(). Teams that assumed rollback was atomic will need to wrap down() bodies in transactions where partial reversion matters. This is a real correctness gap that the release surfaces rather than closes.stop_on_error still governs forward runs only; rollback always stops. That asymmetry is defensible (it preserves rollback ordering) but is a documented footgun for anyone who reads stop_on_error as a global setting.Key questions.
down() fail, and what did we do next? Those are the exact runbooks that change.down() methods that could leave partial state? If so, is transaction wrapping feasible given the DDL/DML involved?Stack fit. Standard Laravel application with Composer, artisan, and a relational database. No new infrastructure, no queue or cache dependency implied by the release. The package's value scales with how much one-off data correction the team performs — teams that regularly hand-write "fix the rows" scripts get the most, teams that only manage schema get little.
Migration path. Two distinct paths, both low-friction:
No data backfill is described, and none is required for the 4.0.x path.
Compatibility. PHP 8.2–8.5, Laravel 11–13. The matrix is explicit: Laravel 13 requires PHP 8.3+, while 8.2 remains viable on Laravel 11/12. For production, the package's own guidance is to prefer patched Laravel 12.69+ or 13.30+ — that is a recommendation worth encoding directly into our dependency constraints rather than leaving to individual developers.
Sequencing.
down() in staging to observe the stop, the rethrow, and the preserved record — this is the only reliable way to validate that our runbooks match reality.down() that mutates more than one statement, where the database supports transactional DDL.Maintenance. Low and decreasing. The package ships a real test matrix (154 tests / 403 assertions), runs it on both the merged master commit and the version tag, and has refreshed its Testbench/Pest/PHPUnit tooling and GitHub Actions. Building on the tag and the merge commit is a meaningful supply-chain signal — it catches the case where the tagged artifact differs from what was reviewed. Documentation metadata and rollback guidance were corrected in the same release, which suggests maintenance attention is going to the parts operators actually read.
Support. Single-maintainer-adjacent project; the release notes reference one PR (#15) and a clean dependency audit for Laravel 12/13. That is a small bus factor. Mitigation: the package is thin (a ledger table, an artisan command, an event surface), so a fork-and-own contingency is cheap if the maintainer disappears. Laravel 11 support is best read as a compatibility courtesy, not a support commitment — the upstream advisories are outside the package's control.
Scaling. The workload is bounded by the number of patches and the cost of each patch body, executed serially against the ledger. This is not a throughput-sensitive component; it runs during deploys, not in the request path. The relevant scaling concern is ledger growth and rollback time — long patch histories make a full rollback a long, now-stop-on-first-failure operation. Plan rollback scope rather than attempting full-ledger reversals.
Failure modes. This release materially improves the most dangerous one.
down() could be recorded as rolled back, discarding history and desynchronizing the ledger from the database. Recovery required manual forensics.down() are not automatically reverted. This is the failure mode to design against, and it is explicitly flagged.stop_on_error, so forward and backward failure semantics diverge; operators should be told in one sentence rather than left to discover it.Ramp-up. Low for anyone who knows Laravel migrations — the concepts transfer directly, and the artisan surface is familiar. The new operational knowledge is narrow and documentable in a short runbook: rollback stops on failure, fix before retry, wrap multi-statement down() bodies in transactions, check the ledger after a failed rollback. Budget roughly half a day of engineering time for the upgrade plus a staging drill, and an hour of documentation work. Onboarding a new engineer to the package itself is near-zero once they have read the rollback page of the docs.
How can I help you explore Laravel packages today?