Home > Enterprise >  php laravel i have a problem in composer when install or remove packages or write any command for co
php laravel i have a problem in composer when install or remove packages or write any command for co

Time:09-21

PHP laravel I have a problem in composer when installing or remove packages or writing any command for the composer

enter image description here

CodePudding user response:

  • first of all your composer command should be composer remove laravel/telescope instead of vendor/telescope.

  • you should rename this file from app/Models/Service_old.php to app/Models/Service.php, if there is another file in the same directory with the same Service.php name, then move the old one (or change its extension) somewhere else so it will not be auto detected by composer.

  • at last, while the package discovery issue is not provided in the screenshot, you may run the following commands and see how things went after:

composer clear-cache
composer dump-autoload
php artisan optimize:clear

CodePudding user response:

Make sure your storage/ & bootstrap/cache directory writable.

Make sure your .env file doesn't contain any spaces.

Ex: key=value instead of key=va lue

remove the bootstrap/cache/config.php file. then

composer dump-autoload

Try to remove /bootstrap/compiled.php ( if you have it )

most likely the problem is with caching as all what we do here is remove the cached files

  • Related