*/ final class RegistrationFormFieldFactory extends Factory { protected $model = RegistrationFormField::class; /** @return array */ public function definition(): array { $label = fake('nl_NL')->unique()->words(2, true); return [ 'event_id' => Event::factory(), 'label' => ucfirst($label), 'slug' => Str::slug($label), 'field_type' => RegistrationFieldType::TEXT, 'options' => null, 'tag_category' => null, 'is_required' => false, 'is_portal_visible' => true, 'is_admin_only' => false, 'is_filterable' => false, 'section' => null, 'help_text' => null, 'sort_order' => fake()->numberBetween(0, 20), ]; } public function textField(): static { return $this->state(fn () => [ 'label' => 'Noodcontact naam', 'slug' => 'noodcontact-naam', 'field_type' => RegistrationFieldType::TEXT, 'section' => 'Noodcontact', ]); } 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, ]); } public function multiselectField(): static { return $this->state(fn () => [ 'label' => 'Dieetwensen', 'slug' => 'dieetwensen', 'field_type' => RegistrationFieldType::MULTISELECT, 'options' => ['Vegetarisch', 'Veganistisch', 'Halal', 'Glutenvrij', 'Lactosevrij', 'Geen pinda\'s', 'Geen noten'], 'is_filterable' => true, ]); } public function booleanField(): static { return $this->state(fn () => [ 'label' => 'Toestemming gegevensverwerking', 'slug' => 'toestemming-gegevensverwerking', 'field_type' => RegistrationFieldType::BOOLEAN, 'is_required' => true, 'section' => 'Toestemming', 'help_text' => 'Ik geef toestemming voor de verwerking van mijn persoonsgegevens conform de AVG.', ]); } public function tagPickerField(): static { return $this->state(fn () => [ 'label' => 'Vaardigheden', 'slug' => 'vaardigheden', 'field_type' => RegistrationFieldType::TAG_PICKER, 'is_filterable' => true, ]); } public function radioField(): static { return $this->state(fn () => [ 'label' => 'Vergoeding', 'slug' => 'vergoeding', 'field_type' => RegistrationFieldType::RADIO, 'options' => ['Pro Deo', 'Entreeticket', 'Vrijwilligersvergoeding'], 'section' => 'Vergoeding', ]); } public function textareaField(): static { return $this->state(fn () => [ 'label' => 'Opmerkingen', 'slug' => 'opmerkingen', 'field_type' => RegistrationFieldType::TEXTAREA, ]); } }