'일반', self::TYPE_SIGNATURE => '서명', self::TYPE_IMAGE => '이미지', self::TYPE_REFERENCE => '참고자료', ]; protected $fillable = [ 'document_id', 'file_id', 'attachment_type', 'description', 'created_by', ]; protected $attributes = [ 'attachment_type' => self::TYPE_GENERAL, ]; // ========================================================================= // Relationships // ========================================================================= public function document(): BelongsTo { return $this->belongsTo(Document::class); } public function file(): BelongsTo { return $this->belongsTo(File::class); } public function creator(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } // ========================================================================= // Accessors // ========================================================================= public function getTypeLabelAttribute(): string { return self::TYPE_LABELS[$this->attachment_type] ?? $this->attachment_type; } }