seed single table in laravel code example
Example 1: laravel migration seed fresh
php artisan migrate:fresh --seed
Example 2: seed specific table
php artisan db:seed --class=UserTableSeeder
Example 3: laravel 8 seeding
php artisan make:seeder UserSeeder
Example 4: laravel 8 seeding
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$this->call([
UserSeeder::class,
PostSeeder::class,
CommentSeeder::class,
]);
}