Skip to content
Advertisement

Target class [DatabaseSeedersRoleTableSeeder] does not exist

So I’ve been creating a CMS with Laravel and when I run this command to migrate the tables

JavaScript

I’ve been experiencing this error

JavaScript

I’ve tried searching to see if someone has the same problem as me, but there seem to be no similar problems. I also can’t tell if the migrations went through or not.

EDIT: Here is the seeder class

JavaScript

Here is the project structure

JavaScript

Advertisement

Answer

From the docs https://laravel.com/docs/8.x/upgrade#seeder-factory-namespaces

JavaScript

Also just as a Laravel TIP

Instead of

JavaScript

Consider using

JavaScript

It’s much cleaner

Don’t forget to add $fillable property in you Role model

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement