diff --git a/src/Console/stubs/user-factory.stub b/src/Console/stubs/user-factory.stub index 0ed2cdac..1caebfe6 100644 --- a/src/Console/stubs/user-factory.stub +++ b/src/Console/stubs/user-factory.stub @@ -3,6 +3,7 @@ namespace {{ factoryNamespace }}; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; use {{ namespacedModel }}; @@ -11,6 +12,8 @@ use {{ namespacedModel }}; */ class UserFactory extends Factory { + protected static ?string $password; + /** * The name of the factory's corresponding model. * @@ -29,7 +32,7 @@ class UserFactory extends Factory 'name' => fake()->name(), 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'password' => static::$password ??= Hash::make('password'), 'remember_token' => Str::random(10), ]; }