mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
Use precomputed hash instead of bcrypt in ModelFactory
This commit is contained in:
parent
268953862f
commit
b041a03878
@ -15,7 +15,12 @@ $factory->define(App\User::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'email' => $faker->safeEmail,
|
||||
'password' => bcrypt(str_random(10)),
|
||||
|
||||
// Use a precomputed hash of the word "secret" instead of using bcrypt directly.
|
||||
// Since bcrypt is intentionally slow, it can really slow down test suites in
|
||||
// large applications that use factories to generate models in many tests.
|
||||
'password' => '$2y$10$oPCcCpaPQ69KQ1fdrAIL0eptYCcG/s/NmQZizJfVdB.QOXUn5mGE6',
|
||||
|
||||
'remember_token' => str_random(10),
|
||||
];
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user