'integer', ]; public function template(): BelongsTo { return $this->belongsTo(P2hTemplate::class, 'template_id'); } /** * Konversi question_type (termasuk nilai legacy) ke label standar resmi. */ public function getQuestionTypeLabelAttribute(): string { return match(strtolower(trim($this->question_type))) { 'multiple lines text box', 'textarea' => 'Multiple Lines Text Box', 'single line text box', 'text' => 'Single Line Text Box', 'numerical value', 'number' => 'Numerical Value', 'date' => 'Date', 'datetime' => 'Datetime', 'multiple choice: only one answer', 'choice', 'condition' => 'Multiple choice: only one answer', 'multiple choice: multiple answers allowed', 'multiple_choice' => 'Multiple choice: multiple answers allowed', 'matrix' => 'Matrix', default => $this->question_type, }; } }