diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index cedde91f..47ee0e87 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -24,21 +24,25 @@ class UserFactory extends Factory * * @return array */ - public function definition(): array + private static $fakerInstance; + +public function definition(): array { + if (!self::$fakerInstance) { + self::$fakerInstance = \Faker\Factory::create(); + } + + $faker = self::$fakerInstance; + return [ - 'name' => $this->faker->name(), - 'email' => $this->faker->unique()->safeEmail(), - 'telefono' => $this->faker->phoneNumber(), - 'direccion' => $this->faker->address(), + 'name' => $faker->name(), + 'email' => $faker->unique()->safeEmail(), + 'telefono' => $faker->numerify('##########'), + 'direccion' => $faker->address(), 'status' => 1, 'email_verified_at' => now(), 'password' => static::$password ??= Hash::make('password'), - 'two_factor_secret' => null, - 'two_factor_recovery_codes' => null, 'remember_token' => Str::random(10), - 'profile_photo_path' => null, - 'current_team_id' => null, ]; }