Jese Leos


Updating Laravel 10 to 11

Upgrading from Laravel 10 to 11 is straightforward but requires attention to a few key steps. 

 

1) Upgrade PHP Version

Ensure your server is running PHP 8.2. Update your Apache server (like XAMPP or WAMP) to the required version.

 

2) Update composer.json

Modify the composer.json file to reflect the necessary changes. Atleast your dependencies should look something like this:

 

"require": {
   "php": "^8.2",
   "dompdf/dompdf": "^2.0",
   "guzzlehttp/guzzle": "^7.2",
   "intervention/image": "^2.7",
   "laravel/framework": "^11.0",
   "laravel/sanctum": "^4.0",
   "laravel/tinker": "^2.8",
   "league/omnipay": "^3.2",
   "omnipay/paypal": "^3.0"
},
"require-dev": {
   "fakerphp/faker": "^1.9.1",
   "laravel/pint": "^1.0",
   "laravel/sail": "^1.18",
   "mockery/mockery": "^1.4.4",
   "nunomaduro/collision": "^8.1",
   "phpunit/phpunit": "^10.0",
   "spatie/laravel-ignition": "^2.0"
}

 

3) Run composer update

Use the following command to update your Laravel and other dependencies:

In terminal

composer update

 

4) Verify Laravel Version

To confirm the upgrade, check your Laravel version by running:

In terminal

php artisan --version

It should now display Laravel Framework 11.x.x.

 

5) Run Laravel Project

Finally, start your Laravel project using:

In terminal

php artisan serve

Your project is now successfully upgraded to Laravel 11!                                      

 

Here are few advantages of laravel 11

 

1. Performance Improvements

Laravel 11 introduces various optimizations that enhance performance, making your application faster and more efficient.

 

2. Improved Security

Laravel 11 comes with updated security features to protect against vulnerabilities.

 

3. Support for PHP 8.2

Laravel 11 requires PHP 8.2, which brings improved performance, more refined language features, and security enhancements. Upgrading helps you leverage the benefits of the latest PHP version.

 

4. New Features

Laravel 11 introduces new features like improved error handling, more flexible route handling, and enhanced Eloquent performance, giving you more tools to build better applications.

 

5. Better Developer Experience

Laravel 11 continues to improve the developer experience with updated tools and clearer documentation. Tools like Laravel Pint (for code styling) and improved testing support make development smoother.