title: Laravel 4 package not loading class path properly
body: <p>I am having trouble with loading classes in one of my Laravel 4 packages. I get the common "Class Not Found" error, which happens when <code>composer.json</code> does not have the proper namespace-path mapping. I have tried adding everything to the <code>composer.json</code> file, but nothing seems to work, not <code>psr-0</code>, nor <code>classmap</code>, nor <code>files</code>. However, if I try to use the full path of the class when declaring a new object:</p>
  
  <p><code>$foo=new Myvendor\Mypackage\Domain\Models\Mymodel;</code></p>
  
  <p>it works quite well. However, I don't want to have to declare the entire path every time I need the object. The fact that the class with the full filepath works shows me that I'm getting very close to the solution.</p>
  
  <p>Edited: Some code</p>
  
  <p>My class, which is located on:<code>src\Myvendor\Mypackage\Domain\Models\Complainant.php</code> relative to the package root</p>
  
  <pre><code>&lt;?php namespace Myvendor\Mypackage\Domain\Models;
  
  class Complainant {
  public $fname;
  public $lname;
  }
  </code></pre>
  
  <p>A part of my <code>composer.json</code> file:</p>
  
  <pre><code>"autoload": {
      "psr-0": {
          "Myvendor\\Mypackage": "src/"
      }
  },
  </code></pre>
  
  <p>This code does not work:</p>
  
  <pre><code>$var=new Complainant;
  </code></pre>
  
  <p>While the following does:</p>
  
  <pre><code>$c=new Myvendor\Mypackage\Domain\Models\Complainant;
  </code></pre>