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

rafito's avatar

New classes not found after deploy

I'm getting this issue all the time after deploying on production. Even if I run 'composer dump-autoload' before deploying.

"message": "Class 'App\Models\NewClass' not found", "exception": "Error",

my build settings vapor.yml:

    build:
        - 'php artisan clear-compiled'
        - 'composer dump-autoload'
        - 'composer install --no-dev --classmap-authoritative'
        - 'php artisan event:cache'
        - 'npm install && npm run prod && rm -rf node_modules'
0 likes
2 replies
Sinnbeck's avatar

Well most likely you have a typo in either a file name or class name. Case matters.

Newclass != NewClass
rafito's avatar

That's not the case, the name of the real class is 'Banner'. But I have this issue all the time with new Models. I have to run 'vapor deploy production' several times until it works.

Please or to participate in this conversation.