9

A Quick Guide to Upgrading Laravel to Version 9 🚀

 2 years ago
source link: https://hackernoon.com/a-quick-guide-to-upgrading-laravel-to-version-9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Hello everyone 👋,

Today I will be going through how to upgrade your Laravel application to version 9, Laravel 9 was released on the 8th of February 2022. It includes many new features but one that stands out is the fact that the latest release only goes with the minimum version of PHP 8.0 🤯!

Yes, this certainly means if your Laravel application is in Laravel 8 or older version you might need to upgrade your PHP version before upgrading the application.

The following are major updates in L9

  1. Minimum PHP version of 8.0. requirement

  2. Shift from swift mailer to symfony mailer

  3. Upgrade of the file system to file system 3. x

  4. Improved Eloquent Accessors / Mutators

  5. Enum Eloquent Attribute Casting

  6. Implicit Route Bindings With Enums

  7. Forced Scoping Of Route Bindings.

  8. Controller Route Groups. 👌

  9. Laravel Scout Database Engine

  10. Rendering Inline Blade Templates. 👍

  11. Slot Name Shortcut

  12. Checked / Selected Blade Directives 👏

  13. Bootstrap 5 Pagination Views ( Paginator::useBootstrapFive(); )

  14. Improved Validation Of Nested Array Data

  15. Laravel Breeze API & Next.js.

  16. Improved Ignition Exception Page

  17. Improved route: list CLI Output.

  18. Test Coverage Using Artisan test Command

  19. Socket Echo Server

  20. New Helpers.

Above are some of the major updates that are in L9, I won't go over them in this article but I will select some of them and create articles explaining what the exact update is and how it works so stay tuned.

So how do I Upgrade my Laravel Application?

I'll be upgrading my own application to version 9 from version 8 hence this article will be a good explainer so just follow along,

First, let's go over our composer.json file and look for laravel/framework and nunomaduro/collision you can look at mine below

Change `laravel/framework package from ^8.12 to ^9.0

Change nunomaduro/collision from ^5.0 to ^6.1

change facade/ignition to “spatie/laravel-ignition”: “¹.0”

Then run

composer update

After you have finished running the composer update go to the following page and read about some high-impact changes that you need to make https://laravel.com/docs/9.x/upgrade depending on which version you upgrading there will be a few differences in the skeleton framework that you need to make.

Notice this guide is to help you quickly update your application. There may be a few files that need to be updated that have not been listed on this guide. Please do not forget to read the upgrade documentation that is available on the official laravel website.

Before you go… Thanks for reading the article!

Any questions or comments hit me up on

Mail: [email protected]

Twitterhttps://twitter.com/epmnzava

Githubhttps://github.com/dbrax


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK