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
+7 -4
View File
@@ -25,10 +25,13 @@ class UserFactory extends Factory
* @return array<string, mixed> * @return array<string, mixed>
*/ */
public function definition(): array public function definition(): array
{ {
return [ return [
'name' => fake()->name(), 'name' => $this->faker->name(),
'email' => fake()->unique()->safeEmail(), 'email' => $this->faker->unique()->safeEmail(),
'telefono' => $this->faker->phoneNumber(),
'direccion' => $this->faker->address(),
'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_secret' => null,
@@ -37,7 +40,7 @@ class UserFactory extends Factory
'profile_photo_path' => null, 'profile_photo_path' => null,
'current_team_id' => null, 'current_team_id' => null,
]; ];
} }
/** /**
* Indicate that the model's email address should be unverified. * Indicate that the model's email address should be unverified.
@@ -16,8 +16,8 @@ return new class extends Migration
$table->string('name'); $table->string('name');
$table->string('email')->unique(); $table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable(); $table->timestamp('email_verified_at')->nullable();
$table->unsignedBigInteger('telefono')->unique(); $table->string('telefono',20)->nullable()->unique();
$table->string('direccion'); $table->string('direccion')->nullable();
$table->string('password'); $table->string('password');
$table->string('code')->nullable(); $table->string('code')->nullable();
$table->boolean('status'); $table->boolean('status');