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

spiritkiddie's avatar

User::class not found on shared hosting

Following DDD pattern, this is my structure

"psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/",
            "Modules\\": "modules/"
 }

All app files live at Modules\Domain etc. i have also changed the config\Auth providers model to match the exact namespace for User::class and cleared cache, composer du but still getting "User::class not found error" hav no idea whats going on. But it runs on local server with no issues

0 likes
1 reply
Snapey's avatar

This sort of difference between production and local is often due to a letter case error, only showing when you run on a case-sensitive environment.

1 like

Please or to participate in this conversation.