'integer', 'attachment_paths' => 'array', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; /** * 가망고객 */ public function prospect(): BelongsTo { return $this->belongsTo(SalesProspect::class, 'prospect_id'); } /** * 작성자 */ public function manager(): BelongsTo { return $this->belongsTo(SalesManager::class, 'manager_id'); } /** * 상담 유형 라벨 */ public function getConsultationTypeLabelAttribute(): string { return match ($this->consultation_type) { 'text' => '텍스트', 'audio' => '음성', 'file' => '파일', default => $this->consultation_type, }; } /** * 상담 유형별 아이콘 클래스 */ public function getConsultationTypeIconAttribute(): string { return match ($this->consultation_type) { 'text' => 'fa-comment', 'audio' => 'fa-microphone', 'file' => 'fa-paperclip', default => 'fa-question', }; } /** * 첨부파일 개수 */ public function getAttachmentCountAttribute(): int { return is_array($this->attachment_paths) ? count($this->attachment_paths) : 0; } /** * 음성 파일 존재 여부 */ public function getHasAudioAttribute(): bool { return !empty($this->audio_file_path); } }