Laravel Upgrade guide from Laravel 5.6 to 8.6 - Laravel Complete Migrate/Upgrade Tutorial
Categories - Laravel PHP Framework Tags - PHP Laravel   Maniruzzaman Akash   3 years ago   2551   2 minutes   0

Laravel Upgrade guide from Laravel 5.6 to 8.6 - Laravel Complete Migrate/Upgrade Tutorial

Hello everyone, todays tutorial, I'll show you the process of upgrading system of Laravel from 5.6 to 8.xor 8.61 to last current version of Laravel.

Let's start.

 

Github Source Code:

So, Before Start the Project in 5.6 - https://github.com/ManiruzzamanAkash/Laravel-Ecommerce-Site/tree/Part31

After Upgradation to 8.x - https://github.com/ManiruzzamanAkash/Laravel-Ecommerce-Site/tree/Part32

 

Dependecy Upgrade

  1. Upgrade Laravel Version 8.x in composer.json
  2. Upgrade all other dependency versions
  3. Change app\Exceptions\Handler.php file to new one
  4. Add new files in Http\Middleware folder according to new Laravel 8
  5. Uncaught ReflectionException: Class env does not exist - 
    1. php artisan clear 
    2. php artisan config:clear
  6. Class 'Fideloper\Proxy\TrustProxies' not found - 
    1. composer require fideloper/proxy
  7. Delete all cached files -
    1.  storage/framework/views/* all files or
    2. if possible delete files also fromcache/data/*or
    3. just run the command - php artisan view:clear

Code Upgrade

  1. Update Route declaration system according to 8.x
  2. Update some Helper files function like str_slug() to Str::slug() - 
    1. https://laravel.com/docs/8.x/helpers#method-str-slug
  3. Update some Helper files function like str_random() to Str::random() - 
    1. https://laravel.com/docs/8.x/helpers#method-str-random
  4. count() deprecated issue
  5. Auth system updated with frontend sanctum or -
    1. Install laravel/ui - composer require laravel/ui
    2. Install Node JS and npm
      1. https://nodejs.org/en/
      2. npm install - npm i
  6. Check if any issues while running the project

 

Previous
PHP If-else-elseif and Switch-case
Next
PHP String Functions - All necessary String functions in PHP to manage strings better.