Upgrading a production app from Laravel 10 to 12
A live Laravel 10 application needed to move to Laravel 12 to stay supported and secure. I planned and carried out a sequential 10 → 11 → 12 upgrade, including the move to PHP 8.2+ and Carbon 3, without putting production at risk.
Staying supported and secure
Every Laravel major version eventually stops receiving bug and security fixes, and packages drop support for old versions. Staying on Laravel 10 meant falling further behind on security fixes, PHP versions and the package ecosystem, and each skipped version makes the eventual upgrade harder.
One major version at a time
Jumping straight from 10 to 12 would have mixed two sets of breaking changes, making failures hard to trace. Instead, I took a sequential path:
- Audit first: list every Composer dependency, check each one's support for Laravel 11 and 12 and for PHP 8.2+, and note which needed updates or replacements.
- 10 → 11: update the framework and dependencies, work through the upgrade guide's breaking changes, and test the application.
- 11 → 12: repeat the process for the next major version.
- PHP 8.2+ and Carbon 3: resolve the behaviour changes these bring, especially in date and time handling.
Doing it step by step meant every failure could be traced to one specific change, so the fix was quick and safe.
Dependencies and breaking changes
The real work in a Laravel upgrade is rarely the framework itself. It is the packages around it and the places where the app relied on old behaviour. I resolved dependency conflicts in Composer, updated or replaced packages that lagged behind, and fixed code affected by framework and Carbon changes, testing each area before moving on.
Results
Tech stack
- Laravel 10
- Laravel 11
- Laravel 12
- PHP 8.2+
- Carbon 3
- Composer