se modifica userfactory para entorno de producción
This commit is contained in:
@@ -24,21 +24,25 @@ class UserFactory extends Factory
|
|||||||
*
|
*
|
||||||
* @return array<string, mixed>
|
* @return array<string, mixed>
|
||||||
*/
|
*/
|
||||||
|
private static $fakerInstance;
|
||||||
|
|
||||||
public function definition(): array
|
public function definition(): array
|
||||||
{
|
{
|
||||||
|
if (!self::$fakerInstance) {
|
||||||
|
self::$fakerInstance = \Faker\Factory::create();
|
||||||
|
}
|
||||||
|
|
||||||
|
$faker = self::$fakerInstance;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => $this->faker->name(),
|
'name' => $faker->name(),
|
||||||
'email' => $this->faker->unique()->safeEmail(),
|
'email' => $faker->unique()->safeEmail(),
|
||||||
'telefono' => $this->faker->phoneNumber(),
|
'telefono' => $faker->numerify('##########'),
|
||||||
'direccion' => $this->faker->address(),
|
'direccion' => $faker->address(),
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'email_verified_at' => now(),
|
'email_verified_at' => now(),
|
||||||
'password' => static::$password ??= Hash::make('password'),
|
'password' => static::$password ??= Hash::make('password'),
|
||||||
'two_factor_secret' => null,
|
|
||||||
'two_factor_recovery_codes' => null,
|
|
||||||
'remember_token' => Str::random(10),
|
'remember_token' => Str::random(10),
|
||||||
'profile_photo_path' => null,
|
|
||||||
'current_team_id' => null,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user