fix: move user definition to UserFactory

This commit is contained in:
b1ek 2024-08-30 08:14:03 +10:00
parent 7e1f1184fe
commit 73f7072b7f
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 8 additions and 12 deletions

View File

@ -24,11 +24,13 @@ class UserFactory extends Factory
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
'last_name' => fake()->lastName,
'name' => fake()->name,
'middle_name' => fake()->name(),
'phone' => fake()->unique()->phoneNumber,
'email' => fake()->unique()->safeEmail,
'password' => Hash::make('password'),
'remember_token' => Str::random()
];
}

View File

@ -15,12 +15,6 @@ class DatabaseSeeder extends Seeder
{
// User::factory(10)->create();
User::factory()->create([
'last_name' => fake()->lastName,
'name' => fake()->name,
'middle_name' => fake()->name(),
'phone' => fake()->unique()->phoneNumber,
'email' => fake()->unique()->safeEmail,
]);
User::factory(10)->create();
}
}