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 public function definition(): array
{ {
return [ return [
'name' => fake()->name(), 'last_name' => fake()->lastName,
'email' => fake()->unique()->safeEmail(), 'name' => fake()->name,
'email_verified_at' => now(), 'middle_name' => fake()->name(),
'password' => static::$password ??= Hash::make('password'), 'phone' => fake()->unique()->phoneNumber,
'remember_token' => Str::random(10), '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(10)->create();
User::factory()->create([ User::factory(10)->create();
'last_name' => fake()->lastName,
'name' => fake()->name,
'middle_name' => fake()->name(),
'phone' => fake()->unique()->phoneNumber,
'email' => fake()->unique()->safeEmail,
]);
} }
} }