Estructura de base de datos, migraciones, factories y seeders

This commit is contained in:
Lucho
2026-06-24 16:28:01 -03:00
parent 317d85b5c3
commit c81120f2e3
42 changed files with 1033 additions and 298 deletions
+11 -1
View File
@@ -29,13 +29,23 @@ class PersonaFactory extends Factory
$cuilPrefix = $this->faker->randomElement(['20', '27']);
$cuilSuffix = $this->faker->numberBetween(0, 9);
$fotoDefault = Foto::firstOrCreate(
['ruta' => 'images/avatar_default.png'],
[
'extension' => 'png',
'tamanio_bytes' => 136788,
'nombre' => 'avatar_default',
'mime_type' => 'image/png',
]
);
return [
'dni' => (string) $dni,
'nombre' => $this->faker->firstName(),
'apellido' => $this->faker->lastName(),
'cuil' => "{$cuilPrefix}{$dni}{$cuilSuffix}",
'fechanac' => $this->faker->dateTimeBetween('-60 years', '-18 years')->format('Y-m-d'),
'foto_id' => Foto::factory(),
'foto_id' => $fotoDefault->id,
];
}
}