0
votes

Help me sort this error out I have removed the class but when I run php artisan I get this error:

Class 'Swap\Laravel\SwapServiceProvider' not found. I have removed it from the app.php file in config and the composer.json file.

in my log

local.ERROR: Class 'Swap\Laravel\SwapServiceProvider' not found {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Class 'Swap\Laravel\SwapServiceProvider' not found at C:\laragon\www\myapp-web\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:208)

I tried to create a new branch and still getting the same error.

1
did you cache your configuration?lagbox
how php artisan cache command?Wells
did you run php artisan config:cache at some point? if so you need to delete the cached configlagbox
yes but I can't run any commandWells

1 Answers

2
votes

You cached your configuration which means you will have to delete that cache config file since that is what is being used and has the reference to the class that does not exist anymore.

Delete the file bootstrap/cache/config.php.

If this is running on your localhost there is no need to cache your configuration. If this is deployed to a server, then that would be a good time to cache the configuration and routes.