Can you post the contents of your Client.php file?
It has to start like this
<?php namespace App\Models;
class Client {
// your code
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, as the title suggests. I have a Client.php model class under App/Models. However, when I put 'use App\Models\Client;' in my controller I get a 'Class 'App\Models\Client' not found' error.
However, if move the Client.php class to App/ the code still works. Is there some crazy cacheing going on somewhere that's not updating my file directory?
As I've previously mentioned you have to change
namespace App;
to
namespace App\Models;
Please or to participate in this conversation.