final class AttachmentService

Service for managing attachment uploads and deletion.

Methods

static Uploads|null
attachmentUpload(EmailAttachments $attachment)

Generates upload object for attachments.

static Users
attachmentUploader(int $id)

Retrieves user who uploaded an attachment.

static void
deleteAttachment(EmailAttachments $attachment)

Deletes an attachment

static string
name(EmailAttachments $attachment)

Sets name for the attachment.

static void
previewAttachment(int $id)

Generates preview for attachment in new tab.

static void
processAttachment(EmailAttachments $attachment, Input $request)

Sets fields for attachment record based on file information and performs uploads.

Details

at line 24
static Uploads|null attachmentUpload(EmailAttachments $attachment)

Generates upload object for attachments.

Parameters

EmailAttachments $attachment

The attachment to upload.

Return Value

Uploads|null

The upload object if the attachment is new, otherwise we return null.

at line 45
static Users attachmentUploader(int $id)

Retrieves user who uploaded an attachment.

Parameters

int $id

User id for uploader of attachment.

Return Value

Users

The user who uploaded the attachment.

at line 56
static void deleteAttachment(EmailAttachments $attachment)

Deletes an attachment

Parameters

EmailAttachments $attachment

The attachment we want to delete from the filesystem.

Return Value

void

at line 70
static string name(EmailAttachments $attachment)

Sets name for the attachment.

Parameters

EmailAttachments $attachment

The attachment whose name is being set.

Return Value

string

The attachment's name.

at line 81
static void previewAttachment(int $id)

Generates preview for attachment in new tab.

Parameters

int $id

The id for the attachment's record.

Return Value

void

at line 102
static void processAttachment(EmailAttachments $attachment, Input $request)

Sets fields for attachment record based on file information and performs uploads.

Parameters

EmailAttachments $attachment

The attachment to process and upload.

Input $request

The request for this update or edit.

Return Value

void