Upgrade Laravel 5.6 to 5.7

I followed a tutorial

https://www.codementor.io/magarrent/how-to-install-laravel-5-xampp-windows-du107u9ji

to install Laravel with Composer on windows. Being new to the PHP world, I didn't realize that 5.1 wasn't the newest version.

I couldn't find an easy way to uninstall it and reinstall or just upgrade to the newest version( at this point 5.8). kept getting errors :

λ composer create-project laravel/laravel laravel "5.7."*

Installing laravel/laravel (v5.7.28) [InvalidArgumentException] Project directory laravel/ is not empty. enter mission change file name. &

λ composer update

Composer could not find a composer.json file in C:\xampp\htdocs To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section &

λ composer global remove laravel/installer

Changed current directory to C:/Users/lenovo/AppData/Roaming/Composer [RuntimeException] Could not read ./composer.json

file_get_contents(./composer.json): failed to open stream: No such file or directory

I navigated in file explorer to:

C:\xampp\htdocs

I :

  1. navigate to C:\xampp\htdocs
  2. highlighted the laravel folder
  3. right click rename "laravel2"

I repasted the install script in commandLine,this time with 5.8 in place of 5.1.

C:\xampp\htdocs λ composer create-project laravel/laravel laravel "5.8."*

bingo

Delete the renamed file: "laravel2".

"windows is moving 4888 files to recycle bin"


I just upgrade laravel to 5.8 with following simple steps:

  1. update in composer.json with "laravel/framework": "5.8.*", enter image description here
  2. Then in console run composer update
  3. Then some library cause problem like in my case yajra/laravel-datatables-oracle enter image description here
  4. Remove line from composer.json file "yajra/laravel-datatables-oracle": "~8.0",
  5. Again in console composer update
  6. Then last Error will be in trustedproxy.php in line 66 enter image description here to get rid from this error:

    a. Remove file trustedproxy.php from config folder of project b. Remove line "fideloper/proxy": "~3.3" c. Again in console composer update

  7. At this point there is error so at last add all the library that we remove before In my case, I in console composer require yajra/laravel-datatables-oracle and composer require fideloper/proxy then at last composer update in console. That's it, hope this help someone.

Just update your laravel/framework dependency to 5.7.* in your composer.json file. Since you are upgrading from 5.6 to 5.7 then, you can easily just run composer update

And if you were doing custom modifications in your 5.6 application, then you can check the Upgrade Guide for a more detailed info.