How to handle Uncaught Error: PHP/Composer class not found?
<p>I'm starting a project with oop as a beginner and I'm trying to use some classes that I think will be recognized by vscode and composer because when I click on their namespace it directs me to the correct class, but when I run the code in the browser I get a fatal error telling me that my class cannot be found. </p>
<p>I tried a lot of things: </p>
<ul>
<li><p>Delete vendor folder and reinstall</p>
</li>
</li>
<li><p>I checked the paths to these folders and everything is fine regardless of php's realpath built-in function</p>
</li>
<li><p>I used the composer-dump-autoload command to update the modifications to composer.json without any changes</p>
</li>
</ul>
<p>I really don’t know where I messed up:</p>
<p>Its index.php file (in the public folder):
</p>
<p>database.php file: </p>
<p>article.php file:
</p>
<p>Finally my composer.json: </p>
<p>I don't know if it's helpful to say this, but when I try to require my model file in the index.php file, it works, but when I remove the requirement, it doesn't work anymore</p>