简体   繁体   中英

Laravel clear package auto-discovery cache of composer packages

I wanted to remove a package from laravel. I did composer remove vendor/package

It was all good on my dev, but when I deploy on production something went wrong and I cannot do anything now.

when I run

php artisan package:discover

I'm geting

In ProviderRepository.php line 208:

Class 'Laracasts\\Flash\\FlashServiceProvider' not found

I'm guessing I it is something to do with some kind of cache or maby config

but I cannot run this command,

php artisan config:clear

because I'm getting the same error message as above.

PS. I'm using Laravel 5.6

You may need clear the autoloader files if they get jammed up as it is looking at those cached files when php artisan config:clear runs, thus creating the jam.

Remove the following files and they will rebuild: /bootstrap/cache/packages.php /bootstrap/cache/services.php

I fixed my problem deleting a config file like so:

$rm bootstrap/cache/config.php

This file is basically a cache for config, if you want to have this file built for you just run a following artisan command:

$php artisan config:cache

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM