I'm having a trouble upgrading laravel. It says that I need to upgrade it sequentially. So I tried updating it to v6.0 first, but I got this error.
> composer update
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires php 7.4.* but your php version (8.1.5) does not satisfy that requirement.
Problem 2
- laravel/framework[v5.8.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.1.5) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, ..., 5.8.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In PackageManifest.php line 122:
Undefined index: name
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
I changed the laravel/framework in composer.json to "6.0.*" and I got this:
Problem 2
- laravel/framework[v6.0.0, ..., v6.0.4] require php ^7.2 -> your php version (8.1.5) does not satisfy that requirement.
- Root composer.json requires laravel/framework 6.0.* -> satisfiable by laravel/framework[v6.0.0, ..., v6.0.4].
That's gonna be a pretty big lift without any automation. The framework has changed quite a bit since 5.x with regard to deprecations, added/removed dependencies, etc. Consider a tool like https://laravelshift.com/ to ease the transition. Countless devs report it's worth the financial cost.
If you don't want to use a service like Laravel Shift, then I would highly recommend installing a fresh Laravel app, and then incrementally migrating your application code over.