G
G
Gleb Sugak2020-09-16 18:00:09
Laravel
Gleb Sugak, 2020-09-16 18:00:09

How to make seeds without errors?

I have a DatabaseSeeder.php file, in which seed classes are connected in this way "$this->call(RolesTableSeeder::class);".
When I try to populate the database in the console using the "php artisan migrate --seed" command, I get the error "Target class [RolesTableSeeder] does not exist.".
I posted the code here - https://github.com/GreatGleb/laravel.admin.panel/t...
I tried to change the database to MySQL-8.0 in OpenServer, reset it by someone, but nothing helps.
When I make a seed from the main DatabaseSeeder.php file, it runs successfully.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2020-09-16
@GreatGleb

namespace Database\Seeders;
Remove.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question