title: Laravel resolving a new namespace - which files to add namespace data
body: <p>In Laravel 4, in <code>app/config/app.php</code>, I find the following line under <code>providers</code>:</p>
  
  <pre><code>'Illuminate\Workbench\WorkbenchServiceProvider',
  </code></pre>
  
  <p>And that service provider works because I verify the <code>register()</code> method is called. I wondered how this maps out namespace-wise.  It appears at least in part that the namespace <code>Illuminate</code> is declared here in <code>/vendor/composer/autoload_namespaces.php</code>:</p>
  
  <pre><code>'Illuminate' =&gt; array($vendorDir . '/laravel/framework/src'),
  </code></pre>
  
  <p>I have created a folder in <code>/vendor</code> called</p>
  
  <pre><code>/vendor/mycompany
  </code></pre>
  
  <p>And then create a class file called MyClass.php as follows</p>
  
  <pre><code>&lt;?php namespace MyCompany;
  
  #MyClass.php
  class MyClass{
      ..etc..
  }
  </code></pre>
  
  <p>I then add the same line in <code>/vendor/composer/autoload_namespaces.php</code>:</p>
  
  <pre><code>'MyCompany' =&gt; array($vendorDir . '/mycompany'),
  </code></pre>
  
  <p>And call the following in routes.php:</p>
  
  <pre><code>$test = new MyCompany\MyClass;      //line 15
  print_r(class_get_methods($test));  //line 16
  </code></pre>
  
  <p>BUT, I get this error:</p>
  
  <pre><code>Fatal error: Class 'MyCompany\MyClass' not found in .. line 15
  </code></pre>
  
  <p>How do I solve this and get the namespace <code>MyCompany</code> registered and recognized?</p>