Skip to content

Commit

Permalink
Improve user seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
summerblue committed Feb 7, 2017
1 parent 9e20792 commit 24b30ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion database/factories/ModelFactory.php
Expand Up @@ -13,12 +13,14 @@

$factory->define(App\Models\User::class, function (Faker\Generator $faker) {
$date_time = $faker->date . ' ' . $faker->time;
static $password;

return [
'name' => $faker->name,
'email' => $faker->safeEmail,
'is_admin' => false,
'activated' => true,
'password' => str_random(10),
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
'created_at' => $date_time,
'updated_at' => $date_time,
Expand Down

0 comments on commit 24b30ac

Please sign in to comment.