Se terminó de crear los controladores con los métodos CRUD básicos. Lo siguiente es empezar a programar los métodos especificos de cada controlador
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Foto;
|
||||
use App\Models\Persona;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Persona>
|
||||
*/
|
||||
class PersonaFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Persona::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$dni = $this->faker->unique()->numberBetween(20000000, 45000000);
|
||||
$cuilPrefix = $this->faker->randomElement(['20', '27']);
|
||||
$cuilSuffix = $this->faker->numberBetween(0, 9);
|
||||
|
||||
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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user