*/ class AnagraficaCondominialeFactory extends Factory { protected $model = AnagraficaCondominiale::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'amministratore_id' => function () { return Amministratore::factory()->create()->id; }, 'codice_univoco' => strtoupper(bin2hex(random_bytes(4))), 'tipo_soggetto' => 'persona_fisica', 'nome' => $this->faker->firstName(), 'cognome' => $this->faker->lastName(), 'codice_fiscale' => strtoupper(substr(str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'), 0, 16)), ]; } }