title: Class tableseeder does not exist (although it really exists) :S
body: <p>I get this error when trying to migrate plus seeding my database using laravel 5.4 </p>
  
  <blockquote>
    <p>[ReflectionException]   Class PostTagTableSeeder does not exist</p>
  </blockquote>
  
  <p>In fact the file really exist with correct class name</p>
  
  <p><strong>seeds/PostTagTableSeeder.php</strong></p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Seeder;
  use App\Tag;
  use App\Post;
  
  class PostTagTableSeeder extends Seeder
  {
      /**
       * Run the database seeds.
       *
       * @return void
       */
      public function run()
      {
          Model::unguard();
          //DB::table('post_tag')-&gt;delete();
  
          $tag1       = Tag::find(1);
          $tag2       = Tag::find(2);
          $tag3       = Tag::find(3);
          $tag4       = Tag::find(4);
          $post1      = Post::find(1);
          $post2      = Post::find(2);
          $post3      = Post::find(3);
          $post4      = Post::find(4);
          $post5      = Post::find(5);
          $post6      = Post::find(6);
          $post7      = Post::find(7);
          $post8      = Post::find(8);
          $post9      = Post::find(9);
          $post10     = Post::find(10);
          $post11     = Post::find(11);
          $post12     = Post::find(12);
          $post13     = Post::find(13);
          $post14     = Post::find(14);
          $post15     = Post::find(15);
  
          $post1-&gt;tags()-&gt;attach([$tag1-&gt;id,$tag2-&gt;id,$tag3-&gt;id]);
          $post2-&gt;tags()-&gt;attach([$tag2-&gt;id,$tag4-&gt;id]);
          $post3-&gt;tags()-&gt;attach([$tag2-&gt;id,$tag3-&gt;id,$tag4-&gt;id]);
          $post4-&gt;tags()-&gt;attach([$tag4-&gt;id]);
          $post5-&gt;tags()-&gt;attach([$tag2-&gt;id]);
          $post6-&gt;tags()-&gt;attach([$tag2-&gt;id]);
          $post7-&gt;tags()-&gt;attach([$tag2-&gt;id]);
          $post8-&gt;tags()-&gt;attach([$tag1-&gt;id,$tag4-&gt;id]);
          $post9-&gt;tags()-&gt;attach([$tag1-&gt;id,$tag4-&gt;id]);
          $post10-&gt;tags()-&gt;attach([$tag3-&gt;id]);
          $post11-&gt;tags()-&gt;attach([$tag1-&gt;id]);
          $post12-&gt;tags()-&gt;attach([$tag1-&gt;id]);
          $post13-&gt;tags()-&gt;attach([$tag3-&gt;id]);
          $post14-&gt;tags()-&gt;attach([$tag1-&gt;id,$tag2-&gt;id,$tag4-&gt;id]);
          $post15-&gt;tags()-&gt;attach([$tag1-&gt;id,$tag2-&gt;id,$tag4-&gt;id]);
      }
  }
  </code></pre>
  
  <p><strong>seeds/DatabaseSeeder.php</strong></p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Database\Seeder;
  
  class DatabaseSeeder extends Seeder
  {
      /**
       * Run the database seeds.
       *
       * @return void
       */
      public function run()
      {
          $this-&gt;call(UsersTableSeeder::class);
          $this-&gt;call(AdminsTableSeeder::class);
          $this-&gt;call(PostsTableSeeder::class);
          $this-&gt;call(CategoriesTableSeeder::class);
          $this-&gt;call(CategoryPostTableSeeder::class);
          $this-&gt;call(TagsTableSeeder::class);
          $this-&gt;call(PostTagTableSeeder::class);
          $this-&gt;call(CommentsTableSeeder::class);
      }
  }
  </code></pre>
  
  <p>I have been struggling to fix this issue but yet i still get the same error<a href="https://i.stack.imgur.com/GlU0I.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GlU0I.png" alt="enter image description here"></a></p>