Update cookies preferences

Upgrade Laravel 8 to Laravel 9

It is worth keeping your apps updated to avoid vulnerabilities and to use the latest stack. With some new exciting features Laravel 9 is in my opinion worth updating to. Here is quick guide of how to do it.

In February 2022 a new version of Laravel was released. There are some new and exciting changes in the new version.

 Laravel 9 New Features:

  • Minimum PHP Requirement (at least php 8.0)
  • Anonymous Stub Migration
  • New Query Builder Interface
  • Custom Casts & null
  • PHP 8 String Functions
  • Flysystem 2.0
  • The lang Directory
  • Symfony Mailer
  • Default HTTP Client Timeout
  • The Password Rule
  • Improved Route List Console View

Update

To upgrade your Laravel application, you will need to replace the following packages with these updated versions in your composer.json file

Laravel version

"laravel/framework": "^9.0",

Nunomaduro collision

"nunomaduro/collision": "^6.1",

Find facade/ignition and replace it with

"spatie/laravel-ignition": "1.0",

Some other dependencies you might have to update include

"algolia/scout-extended": "^2.0",
"laravel/scout": "^9.1",
"spatie/laravel-permission": "^5.5",

You should be able to run

composer update

You might have to remove vendor folder and composer.lock file.

Proxies issue

You might get an error such as

Undefined constant Illuminate\Http\Request::HEADER_X_FORWARDED_ALL

to fix this go to app/Http/Middleware/TrustProxies.php

and change 

use Fideloper\Proxy\TrustProxies as Middleware

to

use Illuminate\Http\Middleware\TrustProxies as Middleware;

Laravel Guide

If you happen to get any other issues during the upgrade Laravel does a great job with their docs and their upgrade guide.

Remember that with new Laravel requiring php 8.0 you might have to update your files if you were using lower php versions.

If you are looking to update your app or website check out what we have to offer.


Sebastian

Sebastian Tracz

Senior Magento Developer

Sebastian is a Senior Magento Developer who has worked on eCommerce projects since 2019 and has been with Develo since 2021. Seb’s favourite aspect of web development is impacting clients’ businesses through meticulous detail in development. His favourite aspects of Magento are its flexibility for client growth and its supportive community. His best achievement from his time at Develo so far is writing a top-performing Laravel blog. Outside of work, he is a rockstar in several bands..

Develo is a leading Magento agency and eCommerce web development company based in Birmingham, in the UK, serving clients globally since 2010. We provide our Learn articles to share knowledge of magento web development, web app development and more to the wider web developer community. To extend your team with our white label web developers, collaborate or consult with us on your project contact us here.


...
Sebastian

share:

Ready to start your next project?

See how we can help you accelerate your business