title: Namespace using composer autoload in PHP
body: <p>I'm trying to implement the autoload feature using <code>psr-4</code> with composer but I get this error, even if I've already require it in the index. Please see the error and code below:</p>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Fatal error: Class 'Blog\Classes\Database\Connection' not found in C:\wamp\www\blog-oop\index.php on line 7</p>
  </blockquote>
  
  <p><strong>Code</strong></p>
  
  <p><em>composer.json</em></p>
  
  <pre><code>{
      "autoload": {
          "psr-4": {
              "Blog\\": "app/classes/Database"
          }
      }
  }
  </code></pre>
  
  <p><em>Connection.php</em></p>
  
  <pre><code>&lt;?php
  
  namespace Blog\Classes\Database;
  
  class Connection{
  
  
  }
  </code></pre>
  
  <p><em>index.php</em></p>
  
  <pre><code>&lt;?php
  
  require "vendor/autoload.php";
  
  use Blog\Classes\Database\Connection;
  
  $connection = new Connection;
  </code></pre>
  
  <p><em>Structure</em></p>
  
  <pre><code>&gt;app 
    &gt;classes
      &gt;Database
        &gt;Connection.php
  </code></pre>