Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mapb_1990's avatar

Class not found after deploy

when you deploy the application for a vps, started giving the following error:

Class 'App\Http\Controllers\WebApp\BaseController' not found

The class exists, namespaces are correct and have run the follow commands:

composer dump-autoload
composer dump-autoload -o
php artisan optimize
php artisan cache:clear

ever happened to anyone?

0 likes
4 replies
jekinney's avatar
Level 47

Check the case of the class, namespace and where it's being called. I have a bad tendency to do App\user instead of App\User.

1 like
mapb_1990's avatar

in local (homestead) works. the namespaces, classes name are correct. only doesn't work in vps.

Snapey's avatar

is local (homestead) case sensitive? @jekinney 's response highlights a common issue.

1 like
mapb_1990's avatar

yes, the namespace is wrong. I have Controllers/WebApp instead of Controllers/Webapp

thx

Please or to participate in this conversation.