*/ class VoceSpesaFactory extends Factory { protected $model = VoceSpesa::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'stabile_id' => function () { return Stabile::factory()->create()->id; }, 'codice' => 'V_' . strtoupper(bin2hex(random_bytes(3))), 'descrizione' => $this->faker->words(3, true), 'categoria' => 'acqua', 'tipo_gestione' => 'ordinaria', 'attiva' => true, ]; } }