'Nombor', 'text' => 'Teks', 'textarea' => 'Teks Panjang', 'select' => 'Senarai Pilihan', 'checkbox' => 'Kotak Semak', 'file_reference' => 'Rujukan Fail', 'calculated' => 'Dikira Automatik', ]; protected $fillable = [ 'checklist_section_id', 'checklist_scope_id', 'code', 'formula_token', 'label', 'description', 'input_type', 'options', 'unit', 'is_required', 'is_calculated', 'formula', 'order', ]; protected function casts(): array { return [ 'options' => 'array', 'is_required' => 'boolean', 'is_calculated' => 'boolean', 'order' => 'integer', ]; } public function section(): BelongsTo { return $this->belongsTo(ChecklistSection::class, 'checklist_section_id'); } public function scope(): BelongsTo { return $this->belongsTo(ChecklistScope::class, 'checklist_scope_id'); } public function answers(): HasMany { return $this->hasMany(SubmissionAnswer::class); } public function isNumeric(): bool { return in_array($this->input_type, ['number', 'calculated'], true); } }