Search code examples
phplaravelcomposer-phpautodiscovery

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


Solution

  • 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