Notes on Upgrading Laravel from 5.5 -> 5.6
Start by creating a new upgrade branch from the master branch:
git checkout –b laravel-5.5-upgrade –master
Next Purchase a Laravel shift using this new upgrade branch name
Merge the branch that is created by Laravel shift into this new upgrade branch
Git fetch origin
Git checkout shift-42238
Git checkout laravel-5.5-upgrade
Git merge shift-42238
Now its time to check how the site is doing on our local machine, but first we will want to update composer & clear config, route & view caches:
composer update
php artisan cache:clear
php artisan route: clear
php artisan view:clear
Now it’s time to fix any errors that cop up, our first error is:
array_keys() expects parameter 1 to be array, integer given
Solution: in app -> Http -> Middleware -> TrustProxies.php set the following:
protected $headers = [
Request::HEADER_FORWARDED => 'FORWARDED',
Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR',
Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST',
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
];
our second error is: Class user not found. To fix this we update config -> auth.php to the following:
'model' => App\Models\User::class,