Do you still have reference to debugbar in the .env file ?
Not see how it can have an impact, but I don't have a better idea so far.
I am on a hosted server and I try to optimize the cache on the production server by launching php artisan config:cache. As I cannot run phpcli on the server, I wrote a temporary function in a controller to start this artisan command. I run composer install --optimize-autoloader --no-dev on my local dev server in order to remove any reference to debugbar in the vendor/composer directory and I uploaded these files on the hosted server.
When I run the artisan command "config:cache" I got the following error in laravel.log production.ERROR: Class Barryvdh\Debugbar\Controllers\OpenHandlerController does not exist. They should not be any reference to Debugbar in the code ! .
here is the code for launching the command.
public function artisanCommand(Request $request) {
$key=$request->key;
try {
\Artisan::call($key);
dd(\Artisan::output());
} catch (Exception $e) {
Response::make($e->getMessage(), 500);
}
}
I am guessing, but is seems that you upload your project files manually (or via FTP) to your server.
If so, before uploading run these commands locally:
php artisan route:clear
php artisan config:clear
From the error I am guessing you are uploading the cached routes file, so the router tries to access a Controller that no longer exists.
Locally the error might not happen because if the .env file is configured to local/debug it regenerates the route cache each time.
Please or to participate in this conversation.