Skip to content

Instantly share code, notes, and snippets.

@victorsteven
Created April 15, 2019 16:19
Show Gist options
  • Save victorsteven/0a6f670c9fe6d4dee68c7e44fa3076cd to your computer and use it in GitHub Desktop.
Save victorsteven/0a6f670c9fe6d4dee68c7e44fa3076cd to your computer and use it in GitHub Desktop.
Users Table Seeder file
<?php
use Illuminate\Database\Seeder;
use App\User;
use Faker\Factory;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Factory::create();
User::truncate();
foreach(range(1, 5) as $i) {
User::create([
'name' => $faker->name,
'email' => $faker->unique()->email,
'email_verified_at' => now(),
'password' => bcrypt('password'),
'remember_token' => Str::random(10),
]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment