title: Composer PSR-4 Autoloader Class not found
body: <p>here is my file structure</p>
  
  <pre><code>├── index.php
  ├── composer.json
  ├── src
      ├── Core
          └── Database.php
  ├── vendor
  </code></pre>
  
  <p>In my composer.json file I have</p>
  
  <pre><code>    "autoload": {
          "psr-4": {"Site\\": "src/"}
      }
  </code></pre>
  
  <p>In my Database.php</p>
  
  <pre><code>namespace Core;
  
  class Database {}
  </code></pre>
  
  <p>And in my index.php</p>
  
  <pre><code> $db = new Site\Core\Database();
  </code></pre>
  
  <p>But I get an error: Class 'Site\Core\Database' not found .</p>
  
  <p>I have ran an <code>composer update</code> and <code>composer dump-auto -o</code> but still without success. I have looked at many of the other similar questions there are here but they have not helped.</p>
  
  <p>Thank you</p>