How to upgrade to Laravel 9

Published 11 January 2022 13:00 (2-minute read)

Every year, there is a new Laravel version. This year, it's Laravel 9. In this post, I describe how you can upgrade your Laravel 8 (or lower) application to Laravel 9.

When you want to upgrade your Laravel application to Laravel 9, take a look at the current version of your application. This checklist is made for applications running on Laravel 8 and wants to upgrade to Laravel 9. Other applications need to upgrade to Laravel 8 first.

Laravel 9: release date

At this moment, Laravel 9 is not released (yet). The moment a new release is tagged, it will be available on GitHub. The expected release date is January 25th, 2022. This release will be a new LTS (long-term support) release.

The estimated upgrade time is 30 minutes.

I suggest waiting a few days before upgrading your application to Laravel 9 to give external dependencies the time to upgrade/test the changes.

Laravel 9: update check tool

Want to check if you can upgrade your Laravel project to the latest version (in this case, Laravel 9)? Copy your composer.json and paste it into the "Can I upgrade Laravel yet?" tool made by LaravelShift.

Steps to update Laravel 8 to 9

This year, the upgrade maybe take a bit longer. The expected upgrade time is 30 minutes, which is twice as long as the previous release.

1. High impact changes

There are 3 changes that may have a high impact on your application (upgrading) time. This is because of the new "Flysystem 2.0" & "Symfony Mailer" changes in the framework.

Laravel 9 requires PHP ^8.0, so it's time to prepare you server/packages for it!

Flysystem: "Flysystem powers all of the file manipulation methods provided by the Storage facade".

SwiftMailer to Symfony Mailer: SwiftMailer is no longer maintained as of December 2021.

2. Medium impact changes

There are 8 medium changes.

I'll update this list once Laravel 9 is officially released.

Other upgrade tips

Here are some general tips to help you upgrade your Laravel projects to the latest version.

  1. make use of LaravelShift, an automated way to upgrade your Laravel applications.
  2. check other changes in the "laravel/laravel" project using the GitHub comparison tool.

A big shoutout to the contributors to Laravel, and its packages!

Robin Dirksen
Robin Dirksen

Follow me on Twitter, there I post web-related content, tips/tricks, and other interesting things.

On my blog, you can find articles that I've found useful or wanted to share with anyone else.

If you want to know more about this article or just want to talk to me, don't hesitate to reach out.