Upgrading a family of apps to Laravel 13, PHP 8.5 and React 19 with near-zero downtime
Published 2026-03-12
The situation
The platform is a family of Laravel and React applications that share a template: the same backend layout, the same frontend conventions, the same deployment tooling. When security releases of PHP came out, the question was not whether to upgrade but how to do it across every application without a week of downtime and without surprises in production.
The approach
The upgrade was done once, on the template, and then replayed on each application. That meant the hard problems were solved in one place: the move to PHP 8.5, Laravel 13, React 19, a new router, Tailwind 4 and a new build tool chain. Each application then needed only its own differences. Development environments were upgraded first, always, and each production promotion was a separate decision taken after the development version had been used.
Before any production promotion, the database of the application was dumped and kept. The dump is cheap insurance: if an upgrade misbehaves, the way back is known and tested. A one-line note of where the dump lives went into the working notes so that it could be found without searching.
What went wrong, and what it taught
A container orchestrator keeps running the old image unless it is told otherwise, so the first deployments started a new image build but kept serving from the old PHP container, and the dependency install then failed against the newer lock file. The fix was a deployment step that forces the services to restart onto the freshly built image, and it now reports a failure instead of hiding it.
Database images referenced by a floating tag upgraded themselves on the next stack deployment. Nothing broke, but a minor database version changed without anyone deciding it. The lesson was to dump first and pin exact tags, and pinning is now a tracked task.
The automatic Tailwind upgrade tool turned a large hand-written component stylesheet into hundreds of broken utility blocks. The working fix was to keep the tool's preamble and restore the original stylesheet as plain CSS, renaming only the tokens that had changed. Several smaller things surfaced as well: a package that dropped its brand icons, a strictness change in the type checker around byte arrays, and a date library whose difference functions started returning signed values.
What made it routine
- One template to upgrade first, so each application inherits solved problems.
- Development before production, every time, with a human approving each promotion.
- A database dump before any production change, with its location written down.
- A deployment step that fails loudly instead of leaving the old version running.
- Gotchas recorded as they appear, so the next application takes minutes instead of hours.
Takeaway
A major upgrade across many applications is mostly an exercise in reducing variety. The fewer ways the applications differ, the more the work collapses into a single, repeatable procedure.