*/ final class FormFieldLibraryFactory extends Factory { protected $model = FormFieldLibrary::class; /** @return array */ public function definition(): array { $name = fake('nl_NL')->randomElement([ 'Shirtmaat (standaard)', 'Dieet (standaard)', 'Noodcontact (standaard)', 'Motivatie (standaard)', ]); return [ 'organisation_id' => Organisation::factory(), 'name' => $name, 'slug' => Str::slug($name).'-'.Str::lower(Str::random(4)), 'field_type' => FormFieldType::TEXT->value, 'label' => fake('nl_NL')->words(2, true), 'help_text' => null, 'options' => null, 'validation_rules' => null, 'default_is_required' => false, 'default_is_filterable' => false, 'default_binding' => null, 'translations' => null, 'description' => fake('nl_NL')->sentence(), 'is_active' => true, ]; } public function system(): static { return $this->state(fn () => ['is_system' => true]); } }