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
|
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()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue