*/ final class FormTemplateFactory extends Factory { protected $model = FormTemplate::class; /** @return array */ public function definition(): array { $name = 'Template '.fake('nl_NL')->words(2, true); return [ 'organisation_id' => Organisation::factory(), 'name' => $name, 'slug' => Str::slug($name).'-'.Str::lower(Str::random(4)), 'purpose' => FormPurpose::EVENT_REGISTRATION, 'description' => fake('nl_NL')->sentence(), 'schema_snapshot' => [ 'schema_version' => 1, 'snapshot_created_at' => now()->toIso8601String(), 'schema' => [ 'name' => $name, 'slug' => Str::slug($name), 'purpose' => FormPurpose::EVENT_REGISTRATION->value, 'locale' => 'nl', 'freeze_on_submit' => false, 'section_level_submit' => false, 'settings' => [], ], 'sections' => [], 'fields' => [], ], 'is_active' => true, ]; } public function system(): static { return $this->state(fn () => ['is_system' => true]); } }