1#All of them
2php artisan db:seed
3#One class
4php artisan db:seed --class=UserSeeder
1<?php
2
3namespace Database\Seeders;
4
5use Illuminate\Database\Seeder;
6use Illuminate\Support\Facades\DB;
7use Illuminate\Support\Facades\Hash;
8use Illuminate\Support\Str;
9
10class DatabaseSeeder extends Seeder
11{
12 /**
13 * Run the database seeders.
14 *
15 * @return void
16 */
17 public function run()
18 {
19 DB::table('users')->insert([
20 'name' => Str::random(10),
21 'email' => Str::random(10).'@gmail.com',
22 'password' => Hash::make('password'),
23 ]);
24 }
25}