5

I'm seeding in Laravel 5.4 but it only seeds one table, the others are not seeded. The seeders were created using the command:

php artisan make:seeder seederName
FelixSFD
  • 6,052
  • 10
  • 43
  • 117

1 Answers1

5

You should register all seeders in the DatabaseSeeder.php:

$this->call(UsersTableSeeder::class);
$this->call(PostsTableSeeder::class);
$this->call(CommentsTableSeeder::class);

Within the DatabaseSeeder class, you may use the call method to execute additional seed classes. Using the call method allows you to break up your database seeding into multiple files so that no single seeder class becomes overwhelmingly large.

https://laravel.com/docs/5.4/seeding#calling-additional-seeders

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279