Achieve the World’s Most Prestigious Certifications and Unlock Top-Paying Careers! Get Certified in the Industry’s Leading Programs Today.
🚀 DevOps Certified Professional 🚀 SRE Certified Professional 🚀 DevSecOps Certified Professional 🚀 MLOps Certified Professional
📅 Starting: 1st of Every Month 🤝 +91 8409492687 | 🤝 +1 (469) 756-6329 🔍 Contact@DevOpsSchool.com

ReflectionException : Class BlogsTableSeeder does not exist

Laravel

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.

Subscribe
Notify of
guest


0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x