Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i Update my laravel to latest version(8 or above)

Currently I am using Laravel 4.2.

I have tried this command - composer global require laravel/installer It is installing the 4.2 Version itself. I need to update it to the latest version. Any suggestions..

My PHP version is 7.3


2 Answers

If you meant upgrade Laravel installer, just reinstall

composer global remove laravel/installer 
composer global require laravel/installer

4.2 is the latest version of the installer(not the framework), you could install Laravel framework 8.0 using Laravel installer 4.2 https://packagist.org/packages/laravel/installer

You can create a Laravel 8 project using the below command:

laravel new example-app
cd example-app
php artisan --version

php artisan --version should show the latest version of the Laravel framework

If you meant to upgrade your current Laravel 4.2 project to 8.0, you need to upgrade to 5(5.0 - 5.8) first, then 6, then 7, and then 8.

Below is how to upgrade from 4.2 to 5.0 https://laravel.com/docs/5.0/upgrade#upgrade-5.0

But the path is too long, it's better to create new latest one and just copy-paste the route and controller.

like image 133
Muhammad Dyas Yaskur Avatar answered Dec 07 '25 19:12

Muhammad Dyas Yaskur


As per the official laravel docs, the recommended way is to create a fresh laravel install and copy the unique application files from your old app to the newly created project

like image 31
Vic Avatar answered Dec 07 '25 19:12

Vic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!