Copied!
Laravel
How to upgrade from Laravel 9 to 10 "In Simple Steps"
Upgrade From Laravel 9 To 10.jpg
Shahroz Javed
Feb 06, 2024 . 78 views

Table Of Contents

 
 

Introduction:

Welcome to this quick guide, In the ever-evolving world of web development, staying up-to-date with the latest technologies and frameworks is crucial. Laravel, known for its elegant syntax and powerful features, is no exception. In this article, we'll guide you through the process of upgrading your Laravel 9 application to the shiny new Laravel 10, with a sprinkle of PHP 8.1 or greater. Let's get started.

 

Prerequisites:

If your composer version is less than 2.2.0 run the following command to upgrade it.

composer self-update
          

This command ensures that you're using the latest version of Composer, a key player in orchestrating Laravel's dependencies.

 

Upgrading dependencies:

In you composer.json upgrade the following core dependencies to laravel 10 compatibality. Additionally, ensure your third-party dependencies align with the latest standards.

// Remove
"fruitcake/laravel-cors": "^2.0",
"facade/ignition": "^2.5",



// Update core
"php": ">=7.4.3 <=8.2.14",
"laravel/framework": "^10.43",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.7",
"laravel/pint": "^1.1",

// Update all third-party dependencies along with these
"fakerphp/faker": "^1.19",
"mockery/mockery": "^1.5",
"nunomaduro/collision": "^6.2",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"            
          
 

Stability is Key:

Set the minimum-stability to "stable" in your composer.json:

"minimum-stability": "stable",

This ensures that your project relies on stable packages, guaranteeing a reliable performance.

 

Composer update

with all the preparations done, let's take the center stage and run the following command:

composer update

This command executes the upgrade, fetching the latest versions of your dependencies and ensuring a seamless transition.

Conclusion:

that's it! You have successfully upgraded from laravel 9 to 10. Embrace the latest features, revel in the performance improvements.

13 Shares

Related Posts

Similar Posts