se modifica userfactory para crear tokens

This commit is contained in:
2026-02-20 16:42:03 -06:00
parent 4658c11367
commit 78916d9d99
2 changed files with 19 additions and 16 deletions
+17 -14
View File
@@ -24,20 +24,23 @@ class UserFactory extends Factory
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'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,
];
}
public function definition(): array
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'telefono' => $this->faker->phoneNumber(),
'direccion' => $this->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,
];
}
/**
* Indicate that the model's email address should be unverified.
@@ -16,8 +16,8 @@ return new class extends Migration
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->unsignedBigInteger('telefono')->unique();
$table->string('direccion');
$table->string('telefono',20)->nullable()->unique();
$table->string('direccion')->nullable();
$table->string('password');
$table->string('code')->nullable();
$table->boolean('status');