code: public function getAttachmentByField(string $field): array
      {
          if (isset($this->attachment[$field])) {
              return $this->attachment[$field];
          }
  
          return [];
      }
docs: getAttachment based on fields