Merge pull request #3894 from adamwathan/53-precomputed-hash

Use precomputed hash instead of bcrypt in ModelFactory
This commit is contained in:
Taylor Otwell 2016-08-21 07:35:24 -05:00 committed by GitHub
commit a2c075bd30
1 changed files with 3 additions and 1 deletions

View File

@ -12,10 +12,12 @@
*/
$factory->define(App\User::class, function (Faker\Generator $faker) {
static $password;
return [
'name' => $faker->name,
'email' => $faker->safeEmail,
'password' => bcrypt(str_random(10)),
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
];
});