1#All of them
2php artisan db:seed
3#One class
4php artisan db:seed --class=UserSeeder
1/**
2 * Run the database seeders.
3 *
4 * @return void
5 */
6public function run()
7{
8 $this->call([
9 UserSeeder::class,
10 PostSeeder::class,
11 CommentSeeder::class,
12 ]);
13}
1class UsersTableSeeder extends Seeder
2{
3 public function run()
4 {
5 $limit = env('SEEDER_LIMIT', 1);
6
7 echo $this->limit;
8 }
9}
10
11//In terminal run:
12SEEDER_LIMIT=10 php artisan db:seed --class=UsersTableSeeder
13