Laravel 5.4 Seeds Not Seeding All Tables
I have planted in Laravel 5.4 but it only seeds one table, others are not seeded. The seeders were created using the command:
php artisan make:seeder seederName
+3
codeOverflow
source
to share
1 answer
You must register all planters in DatabaseSeeder.php
:
$this->call(UsersTableSeeder::class);
$this->call(PostsTableSeeder::class);
$this->call(CommentsTableSeeder::class);
Within the DatabaseSeeder class, you can use a call method to execute additional seed classes. Using the invocation method allows you to split the database seeding into multiple files so that no planter class gets more and more significant.
https://laravel.com/docs/5.4/seeding#calling-additional-seeders
+3
Alexey Mezenin
source
to share