*/ final class RegistrationFieldTemplateFactory extends Factory { protected $model = RegistrationFieldTemplate::class; /** @return array */ public function definition(): array { $label = fake('nl_NL')->unique()->words(2, true); return [ 'organisation_id' => Organisation::factory(), 'label' => ucfirst($label), 'slug' => Str::slug($label), 'field_type' => RegistrationFieldType::TEXT, 'options' => null, 'tag_categories' => null, 'is_required' => false, 'is_filterable' => false, 'is_portal_visible' => true, 'is_admin_only' => false, 'help_text' => null, 'sort_order' => fake()->numberBetween(0, 20), 'display_width' => FieldDisplayWidth::FULL, 'is_system' => false, 'is_active' => true, ]; } public function system(): static { return $this->state(fn () => ['is_system' => true]); } public function inactive(): static { return $this->state(fn () => ['is_active' => false]); } public function selectField(): static { return $this->state(fn () => [ 'label' => 'Shirtmaat', 'slug' => 'shirtmaat', 'field_type' => RegistrationFieldType::SELECT, 'options' => ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'], 'is_filterable' => true, 'display_width' => FieldDisplayWidth::HALF, ]); } public function booleanField(): static { return $this->state(fn () => [ 'label' => 'EHBO / BHV diploma', 'slug' => 'ehbo-bhv-diploma', 'field_type' => RegistrationFieldType::BOOLEAN, 'is_filterable' => true, 'display_width' => FieldDisplayWidth::HALF, ]); } public function tagPickerField(): static { return $this->state(fn () => [ 'label' => 'Certificaten & vaardigheden', 'slug' => 'certificaten-vaardigheden', 'field_type' => RegistrationFieldType::TAG_PICKER, 'is_filterable' => true, 'display_width' => FieldDisplayWidth::FULL, ]); } public function headingField(): static { return $this->state(fn () => [ 'label' => 'Persoonlijke voorkeuren', 'slug' => 'persoonlijke-voorkeuren', 'field_type' => RegistrationFieldType::HEADING, 'help_text' => 'Vertel ons wat we over jou moeten weten', 'display_width' => FieldDisplayWidth::FULL, ]); } }