*/ class PersonFactory extends Factory { /** * Define the model's default state. * * @return array */ 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-######') ]; } }