mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
[10.x] Update fixture hash to match testing cost (#6259)
* Update fixture hash to match testing cost * Conditionally use lower cost in tests * use hash facade and memoize * remove import --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
This commit is contained in:
parent
036ea83da2
commit
7fe97a165a
@ -3,6 +3,7 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
@ -10,6 +11,8 @@ use Illuminate\Support\Str;
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
@ -21,7 +24,7 @@ class UserFactory extends Factory
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$12$Z/vhVO3e.UXKaG11EWgxc.EL7uej3Pi1M0Pq0orF5cbFGtyVh0V3C', // password
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user