title: Laravel DB Seeding not autoloading Model classes
body: <p>In Laravel 4.2 I've suddenly run into an issue where it won't autoload my model classes when I attempt to <code>php artisan db:seed</code>. The strange thing is that it was working fine yesterday, but now today it isn't.</p>
  
  <p>I'm trying some pretty simple stuff:</p>
  
  <p><strong>DatabaseSeeder.php</strong>
      
  
  <pre><code>class DatabaseSeeder extends Seeder {
  
  public function run()
  {
      Eloquent::unguard();
  
      Song::truncate();
  
      $this-&gt;call('SongsTableSeeder');
      $this-&gt;command-&gt;info('Songs table seeded!');
  }
  
  }
  </code></pre>
  
  <p><strong>SongsTableSeeder.php</strong>
      
  
  <pre><code>class SongsTableSeeder extends Seeder {
  
      public function run() 
      {
          $song = [
              // all my fields
          ];
          Song::create($song);
  
      }
  
  }
  </code></pre>
  
  <p>When I run <code>php artisan db:seed</code> I get this error:</p>
  
  <p><code>Class 'Song' not found in /path/to/app/database/seeds/DatabaseSeeder.php</code></p>
  
  <p>I've tried running <code>composer dump-autoload</code> many times as well as <code>php artisan dump-autoload</code>. I've also tried running <code>composer update</code>. </p>
  
  <p>If I explicitly load the class in both files like so: <code>use App\Models\Song;</code></p>
  
  <p>then my database gets seeded properly. But, this sort of defeats the point of Laravel's autoloader, right?</p>
  
  <p>The <code>autoload</code> section of my <code>composer.json</code> looks like:</p>
  
  <pre><code>"autoload": {
      "classmap": [
          "app/commands",
          "app/controllers",
          "app/models",
          "app/database/migrations",
          "app/database/seeds",
          "app/tests/TestCase.php"
      ]
  },
  </code></pre>
  
  <p>And my <code>Song</code> model (<strong>Song.php</strong>) looks like:</p>
  
  <pre><code>&lt;?php namespace App\Models;
  
  class Song extends \Eloquent {
  
  protected $table = 'songs';
  
  }
  </code></pre>
  
  <p>Any ideas?</p>