I’m encountering an error while running composer install in my Laravel 8.12 project with PHP 7.4.33. The error message is:
In Container.php line 879:
Target class [request] does not exist.
In Container.php line 877:
Class "request" does not exist
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Package fruitcake/laravel-cors is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating optimized autoload files
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
In Container.php line 879:
Target class [request] does not exist.
In Container.php line 877:
Class "request" does not exist
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Steps I’ve Already Taken:
Cleared Composer cache (composer clear-cache).
Verified aliases in config/app.php.
Regenerated Composer autoload files (composer dump-autoload).
Deleted vendor directory and composer.lock, then reinstalled dependencies (composer install).
Additional Information:
Laravel version: 8.12
PHP version: 7.4.33
Abandoned packages: fruitcake/laravel-cors and swiftmailer/swiftmailer
What I Need Help With:
Any guidance on resolving the “Target class [request] does not exist” error.
Suggestions for updating or replacing the abandoned packages.
Any additional troubleshooting steps I might have missed.
Thank you!