This commit is contained in:
Refactorian
2024-02-17 23:09:24 +09:00
committed by GitHub
parent edbbe6d81d
commit 953460bca6
12 changed files with 710 additions and 494 deletions

View File

@@ -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,11 @@ use Illuminate\Support\Str;
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
@@ -21,7 +27,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),
];
}