Skip to content

Commit 7fe97a1

Browse files
[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>
1 parent 036ea83 commit 7fe97a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

database/factories/UserFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
namespace Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6+
use Illuminate\Support\Facades\Hash;
67
use Illuminate\Support\Str;
78

89
/**
910
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
1011
*/
1112
class UserFactory extends Factory
1213
{
14+
protected static ?string $password;
15+
1316
/**
1417
* Define the model's default state.
1518
*
@@ -21,7 +24,7 @@ public function definition(): array
2124
'name' => fake()->name(),
2225
'email' => fake()->unique()->safeEmail(),
2326
'email_verified_at' => now(),
24-
'password' => '$2y$12$Z/vhVO3e.UXKaG11EWgxc.EL7uej3Pi1M0Pq0orF5cbFGtyVh0V3C', // password
27+
'password' => static::$password ??= Hash::make('password'),
2528
'remember_token' => Str::random(10),
2629
];
2730
}

0 commit comments

Comments
 (0)