Derek
Derek

Reputation: 5037

Manually clear compiled class - Laravel

I am receiving an error after updating my codebase and I can't seem to get around it. I had used a package I am no longer using, I went through the proper steps to removing the package like this answer but anything I do in the console fails.

I tried running:

composer update

But I receive this error:

user@my-app:~/example.com$ php artisan clear-compiled
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Travoltron\Plaid\PlaidServiceProvider' not found in /home/user/example.com/bootstrap/cache/compiled.php:7825
Stack trace:
#0 /home/user/example.com/bootstrap/cache/compiled.php(7811): Illuminate\Foundation\ProviderRepository->createProvider('Travoltron\\Plai...')
#1 /home/user/example.com/bootstrap/cache/compiled.php(7787): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 /home/user/example.com/bootstrap/cache/compiled.php(1937): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /home/user/example.com/bootstrap/cache/compiled.php(2357): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 /home/user/example.com/bootstrap/cache/compiled.php(1796): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 /home/user/example.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kerne in /home/user/example.com/bootstrap/cache/compiled.php on line 7825
PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Travoltron\Plaid\PlaidServiceProvider' not found in /home/user/example.com/bootstrap/cache/compiled.php:7825
Stack trace:
#0 /home/user/example.com/bootstrap/cache/compiled.php(7811): Illuminate\Foundation\ProviderRepository->createProvider('Travoltron\\Plai...')
#1 /home/user/example.com/bootstrap/cache/compiled.php(7787): Illuminate\Foundation\ProviderRepository->compileManifest(Array)
#2 /home/user/example.com/bootstrap/cache/compiled.php(1937): Illuminate\Foundation\ProviderRepository->load(Array)
#3 /home/user/example.com/bootstrap/cache/compiled.php(2357): Illuminate\Foundation\Application->registerConfiguredProviders()
#4 /home/user/example.com/bootstrap/cache/compiled.php(1796): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#5 /home/user/example.com/ in /home/user/example.com/bootstrap/cache/compiled.php on line 7825

I have already tried running these commands but receive the same error:

composer install
composer dump-autoload
php artisan config:cache
php artisan config:clear
php artisan clear-compiled

My questions is, since this looks like it is just picking up a cached version of the compiled classes is there any way to manually remove the compiled cache since I can't get around doing it via commands?

Upvotes: 0

Views: 9136

Answers (1)

Vishal
Vishal

Reputation: 742

You can remove all the cache files present inside /bootstrap/cache and auto load composer again.

Run below commands once you are in application directory.

rm -r bootstrap/cache/*
composer dump-autoload

Upvotes: 2

Related Questions