Created
April 15, 2019 16:19
-
-
Save victorsteven/0a6f670c9fe6d4dee68c7e44fa3076cd to your computer and use it in GitHub Desktop.
Users Table Seeder file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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