ReflectionException : Class BlogsTableSeeder does not exist

Amit Kumar
Nov 6, 2021

--

When i type php artisan db:seed command. It’s showing this type of errors.

[ReflectionException]
Class UserTableSeeder does not exist

Here is my BlogsTableSeeder

<?php

use Illuminate\Database\Seeder;

class BlogsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
factory(App\Blog::class, 100)->create()->each(function ($blog){
$blog->save();
});
}
}

DatabaseSeeder.php

<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
$this->call(RolesTableSeeder::class);
$this->call(BlogsTableSeeder::class);
}
}

Next let’s go to solve this problem Just run below command.

composer dump-autoload

Now DB seeding Successfully.

--

--

Amit Kumar
Amit Kumar

Written by Amit Kumar

Hi I am Amit Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

No responses yet