AT Logoatdev.blog
Upgrade Laravel 5.x and 7.x to 13: a safe, step-by-step plan
Laravel

Upgrade Laravel 5.x and 7.x to 13: a safe, step-by-step plan

Upgrade Laravel 5.x or 7.x to 13 with the least effort: check packages with Composer, climb Laravel and PHP one step at a time, and avoid 8 silent traps.

On December 1, 2026, Laravel launched Laravel Rust, and Taylor Otwell himself asked how many ambitious new projects in 2027 and beyond will still choose PHP. Whatever the answer, the Laravel 5.x and 7.x systems already running (CRMs, admin panels, ordering systems written in 2018–2020) still need to be safe, and that's a job for today.

This is the short version: how to upgrade Laravel from an old release to Laravel 13 with the least effort, in three steps:

  1. Check your packages with Composer.
  2. Climb one step at a time, changing Laravel or PHP, never both.
  3. Avoid the "silent traps": code that throws no error but behaves differently.

Why upgrade Laravel to 13 now

The official support schedule (checked December 3, 2026):

Laravel PHP Bug fixes until Security fixes until
11 and older Ended Ended
12 8.2 – 8.5 Aug 13, 2026 Feb 24, 2027
13 8.3 – 8.5 Q3 2027 Mar 17, 2028
  • Target Laravel 13. Laravel 12 no longer gets bug fixes, and its security fixes end on February 24, 2027. The latest Laravel 13 release at the time of writing is v13.45.0 (December 1, 2026).
  • Don't wait for Laravel 14. Laravel ships a major version every year around Q1, but as of December 3, 2026 there is no 14.x branch yet. Going from 13 to 14 will be a small step.
  • Target PHP 8.4. It gets security fixes until December 31, 2028, and Laravel's master branch already requires PHP ^8.4.
  • Hold off on PHP 8.6. It was released on November 19, 2026, but Laravel 13's support table still lists 8.3–8.5. Meanwhile PHP 8.2 security support ends on December 31, 2026.

Step 1: check your packages with Composer

The hardest part of a Laravel upgrade is usually not the framework but third-party packages: PDF, Excel, permissions, image processing. Three commands tell you most of what you need.

List vulnerabilities and abandoned packages:

composer audit --locked --abandoned=report

Find what blocks Laravel 13 and PHP 8.4, including indirect packages you never required yourself:

composer why-not laravel/framework 13.0 --locked
composer why-not php 8.4 --locked

Simulate the target on a copy of the project. In composer.json, set "laravel/framework": "^13.0", simulate the PHP version with "config": { "platform": { "php": "8.4.0" } }, loosen the other packages to "*", then do a dry run that installs nothing:

composer update --dry-run -W

Composer either names the packages with no compatible version, or prints the new version each package needs.

Real results from a sample Laravel 8 project (Composer 2.10.3, October 23, 2026):

  • 21 vulnerabilities across 4 packages, and 2 abandoned packages (fruitcake/laravel-cors, swiftmailer/swiftmailer).
  • 6 packages need a major upgrade, for example barryvdh/laravel-dompdf 0.9 → 3.1, spatie/laravel-permission 4.4 → 8.3 and maatwebsite/excel 3.1 → 4.0. Each one means reading its UPGRADE.md.
  • fruitcake/laravel-cors has no release for Laravel 13. That's fine: Laravel has shipped HandleCors and TrustProxies since version 9, so you just remove the package.

Composer only reads what packages declare they support, so still run your test suite on the target PHP (in Docker) before you commit to it.

Step 2: climb one step at a time

Each deploy changes Laravel or PHP, never both. When something breaks, you know why.

Upgrade ladder from Laravel 5.8 on PHP 7.2 to Laravel 13 on PHP 8.4, each step changing only Laravel or PHP and always staying within supported versions

A sample path from Laravel 5.8 on PHP 7.2 (on 5.5–5.7, get to 5.8 first). Times are Laravel's own estimates from the upgrade guides:

Step Change Laravel's estimate Main thing to watch
1 Laravel 5.8 → 6 1 hour str_*/array_* helpers move to laravel/helpers
2 PHP 7.2 → 7.3
3 Laravel 6 → 7 15 min Exception handler takes Throwable
4 Laravel 7 → 8 15 min Class-based model factories
5 PHP 7.3 → 8.1 The biggest PHP jump; can split via 7.4 and 8.0
6 Laravel 8 → 9 30 min Flysystem 3, Symfony Mailer
7 Laravel 9 → 10 10 min $dates removed, use $casts
8 PHP 8.1 → 8.3
9 Laravel 10 → 11 15 min Migration ->change()
10 Laravel 11 → 12 5 min Carbon 3
11 Laravel 12 → 13 10 min CSRF middleware renamed to PreventRequestForgery
12 PHP 8.3 → 8.4

You don't need to adopt the Laravel 11 folder structure: the upgrade guide explicitly doesn't recommend it for existing apps.

Tools that speed up the mechanical part (renamed classes, syntax, config):

  • Laravel Shift: one version per run, from $19, delivered as a pull request of small commits.
  • Rector Laravel: free, rewrites code using per-version rules.
  • Laravel Boost: in a Laravel 12 app, the /upgrade-laravel-v13 command guides an AI agent (Claude Code, Cursor…) through the move to 13.

Small project with code you want to clean up anyway? Starting a fresh Laravel 13 app and porting your code is the only way to jump straight there, at the cost of facing every change from 5.x to 13 at once.

Step 3: avoid the silent traps

Errors on screen are easy to fix. The scary ones are changes where code still runs but behaves differently:

Silent traps when upgrading Laravel: cache in seconds from 5.8, queues try once from 6, JSON date format in 7, Tailwind pagination in 8, Flysystem stops throwing in 9, migration change drops attributes in 11, Carbon 3 in 12, mass logout in 13

  • 5.8: Cache::put('key', $value, 30) goes from 30 minutes to 30 seconds.
  • 6: queues try a job only once by default. Jobs that call external APIs need an explicit $tries.
  • 7: dates in JSON become ISO-8601 in UTC. Mobile apps reading your API may show the wrong time; override serializeDate() to keep the old format.
  • 8: pagination switches to Tailwind. Bootstrap UIs need Paginator::useBootstrap().
  • 9: a failed Storage::put() returns false instead of throwing. Set 'throw' => true on the disk if your code relies on try/catch.
  • 11: migration ->change() drops unsigned, default and comment unless you declare them again.
  • 12: Carbon 3, where diffIn* methods return floats that can be negative.
  • 13: users may be logged out en masse because the session cookie name changes. Pin SESSION_COOKIE, CACHE_PREFIX and REDIS_PREFIX in .env before upgrading.

Deploy each step safely

  • Ship each step to production before starting the next. Bundling five steps into one deploy throws away the point of small steps.
  • Drain the queue before deploying, then run php artisan queue:restart afterwards. Worker setup is covered in Laravel crontab and Supervisor queues on a server.
  • Keep a way back: the previous release ready to switch to, and a database backup before running migrations.
  • Once on 13, run Laravel Doctor for a quick check of the environment, queues and security settings.

Estimating: the project manager's view

Adding up the official upgrade guides from 5.5 to 13 gives about 4 hours, but that's only the framework on a near-default app. Real effort depends on three things: how many packages need a major upgrade (from step 1), how much custom code touches framework internals, and test coverage. Without tests, every step is a round of manual testing, and that's where most of the time goes.

Run step 1 before you quote. A table of "package → new version → work needed" convinces a client better than any explanation.

Upgrade Laravel, or move to Laravel Rust?

For a running system: upgrade first. Laravel Rust is a framework rebuilt for Rust with no automatic code conversion, so moving means a separate rewrite project. Laravel PHP isn't entering maintenance mode either. The full analysis is in Laravel Rust is here: what happens to Laravel PHP?.

Laravel upgrade checklist

  • Run composer audit, composer why-not and the target simulation; settle on Laravel 13 + PHP 8.4.
  • Have tests for payments, orders and login; have staging and a dedicated git branch.
  • Change only Laravel or PHP per deploy; use Shift, Rector or Boost for the mechanical work.
  • Check all 8 silent traps, especially cache seconds and the session cookie in 13.
  • Drain queues before deploying, queue:restart after, and always keep a way back.
  • On 13: update minor releases regularly (Laravel ships almost weekly), add composer audit to CI, and upgrade the major version every year.

Sources

Support dates and versions checked December 3, 2026; Composer results from October 23, 2026.

Frequently Asked Questions

Can I upgrade straight from Laravel 5 to 13 in one go?▾
Not with Composer: you have to go through each major version, because every one of them has breaking changes. The only way to jump is to start a fresh Laravel 13 app and port your code into it, which means handling every change from 5.x to 13 at once.
Should I target Laravel 12 or 13?▾
Laravel 13. Laravel 12 stopped receiving bug fixes on August 13, 2026 and gets security fixes only until February 24, 2027, while Laravel 13 gets security fixes until March 17, 2028. Stop at 12 only if a package you can't drop doesn't support 13 yet.
How do I know whether my packages support Laravel 13?▾
On a copy of the project, set laravel/framework to ^13.0, simulate the target PHP with config.platform.php, loosen the other packages to an asterisk and run composer update --dry-run -W. Composer either names the package with no compatible version or prints the new version each package needs.
How long does upgrading Laravel 5.x to 13 take?▾
Adding up the official upgrade guides gives about 4 hours for the framework itself. The real effort depends on how many packages need a major upgrade, how much custom code touches framework internals and how good your tests are, so estimate after running the package check.
Should I run Laravel 13 on PHP 8.6?▾
Not yet. PHP 8.6 was released on November 19, 2026, but Laravel 13's support table still lists PHP 8.3 to 8.5. PHP 8.4 is the safe target: it gets security fixes until December 31, 2028, and it's what Laravel's development branch requires.
Should I upgrade Laravel or move to Laravel Rust?▾
For a running system, upgrade first. Laravel Rust is a framework rebuilt for Rust with no automatic code conversion, so moving means a separate rewrite project. Laravel PHP isn't entering maintenance mode either.
Enjoyed this article?