diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index d4f4db2a2..5d6eb3f96 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -4,6 +4,7 @@ use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; /** @@ -11,6 +12,8 @@ */ class UserFactory extends Factory { + protected static ?string $password; + /** * The name of the factory's corresponding model. * @@ -32,7 +35,7 @@ public function definition(): array '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), ]; }