migrants-nt-sec/database/factories/PersonFactory.php

35 lines
1.1 KiB
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Person>
*/
class PersonFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'surname' => $this->faker->lastName,
'christian_name' => $this->faker->firstName,
'full_name' => function (array $attributes) {
return $attributes['christian_name'] . ' ' . $attributes['surname'];
},
'date_of_birth' => $this->faker->date('Y-m-d', '-30 years'),
'place_of_birth' => $this->faker->city,
'date_of_death' => $this->faker->optional(0.3)->date('Y-m-d'),
'occupation' => $this->faker->jobTitle,
'additional_notes' => $this->faker->optional()->paragraph,
'reference' => $this->faker->optional()->bothify('REF-####-???'),
'id_card_no' => $this->faker->optional()->bothify('ID-######')
];
}
}