Questions & Answers

How to upgrade Laravel 6 project to Laravel 9

I've been asked on my job to update a Laravel 6 project to version 9. I'm having a lot of issues, i can't even test the project cause it's giving me a lot of errors. First i wanted to check the exact laravel version (i've been told it's 6.2), but I can't even check it with php artisan --version or use php artisan...
Also I would like to know how to do the update, since i can only find enough information to update from 8 to 9 on the official website.


Things i've tried:

-Changed this on composer.json:

"require": { "php": "^7.3|^8.0", ..... },

-Tried this composer commands:

composer update composer install composer update --no-scripts composer require laravel/framework

-I get this errors:

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with Arr
ayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users*******\


Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255


2023-01-18 23:30:09
Do yourself a favor: (it's been well worth the subscription cost in my experience, and you can subscribe for just a month to do the upgrade)
2023-01-18 23:30:09
" it's giving me a lot of errors" - with the current version, or with the updated one?
2023-01-18 23:30:09
Read and follow the upgrade guides for every version
2023-01-18 23:30:09
Just to clarify, do you have experience in Laravel? Or any experience upgrading versions in Laravel projects? If no, then maybe it would be better to explain it to your supervisor.
2023-01-18 23:30:09 or a brand new project. All other options are just wasting of your time.
Answers(0) :