fix: move user definition to UserFactory
This commit is contained in:
parent
7e1f1184fe
commit
73f7072b7f
|
@ -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()
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue