$this->id, 'event_id' => $this->event_id, 'label' => $this->label, 'slug' => $this->slug, 'field_type' => $this->field_type->value, 'options' => $this->options, 'normalized_options' => $this->normalized_options, 'tag_categories' => $this->tag_categories, 'is_required' => $this->is_required, 'is_portal_visible' => $this->is_portal_visible, 'is_admin_only' => $this->is_admin_only, 'is_filterable' => $this->is_filterable, 'help_text' => $this->help_text, 'sort_order' => $this->sort_order, 'display_width' => $this->display_width->value, 'created_at' => $this->created_at->toIso8601String(), 'updated_at' => $this->updated_at->toIso8601String(), 'available_tags' => $this->when( $this->field_type === RegistrationFieldType::TAG_PICKER, function () { $query = PersonTag::where('organisation_id', $this->event->organisation_id) ->where('is_active', true); if (!empty($this->tag_categories)) { $query->whereIn('category', $this->tag_categories); } return PersonTagResource::collection($query->orderBy('category')->orderBy('sort_order')->get()); } ), ]; } }