Install faker from https://github.com/fzaninotto/Faker
composer require fzaninotto/faker
From the command line
php artisan make:seeder UsersTableSeeder
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$this->call(UsersTableSeeder::class);
}
}
use Illuminate\Database\Seeder;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
factory(\App\User::class)->create([
'email' => 'admin@admin.com',
'password' => '123',
]);
factory(\App\User::class, 100)->create();
}
}
0 comments:
Post a Comment