LaravelPackages.net
Acme Inc.
Toggle sidebar
evangeo/tickets

Ticket Support System

12
1
About evangeo/tickets

evangeo/tickets is a Laravel package for ticket support system. It currently has 1 GitHub stars and 12 downloads on Packagist. Install it with composer require evangeo/tickets. Discover more Laravel packages by evangeo or browse all Laravel packages to compare alternatives.

Last updated

Ticket Support System

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Introduction

The Laravel Ticket Support Backend Package is a specialized solution for managing customer support requests and streamlining the back-end processes of your support system. This package is designed to empower your support team by providing the necessary tools for efficient ticket handling and resolution.

Installation

You can install the package via composer:

composer require evangeo/tickets

You can publish and run the migrations with:

php artisan vendor:publish --tag="tickets-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="tickets-config"

Tables

Ticket Table Structure

| Column Name | Type | Default | |-----------------------|------------------------------------------|---------------------| | ID | integer | NOT NULL | | UUID | string | NOT NULL | | title | string | NOT NULL | | description | string | NOT NULL | | entity | string | NOT NULL | | entity_id | int | NOT NULL | | assigned_user | int | NOT NULL | | category_id | int | NULL | | internal_group_id | int | NULL | | status | enum (open, re-open, closed, archived) | open | | waiting_response_from | enum (user, entity) | NOT NULL | | priority | enum (low, normal, high) | low | | closed_by | enum (user, entity) | NULL | | created_at | timestamp | current timestamp | | created_by | int | NULL | | updated_at | timestamp | current timestamp | | modified_by | int | NULL | | deleted_at | timestamp | NULL | | deleted_by | int | NULL |

Ticket Responses Table Structure

| Column Name | Type | Default | |-------------|-----------------------------|---------------------| | id | integer | NOT NULL | | ticket_id | int | NOT NULL | | message | mediumText | NOT NULL | | type | enum (external, internal) | external | | created_at | timestamp | current timestamp | | created_by | int | NULL | | updated_at | timestamp | current timestamp | | modified_by | int | NULL | | deleted_at | timestamp | NULL | | deleted_by | int | NULL |

Ticket Attachment Table Structure

| Column Name | Type | Default | |-------------|-------------|---------------------| | id | integer | NOT NULL | | response_id | int | NOT NULL | | name | string | NOT NULL | | mime | string | NOT NULL | | created_at | timestamp | current timestamp | | created_by | int | NULL | | updated_at | timestamp | current timestamp | | modified_by | int | NULL | | deleted_at | timestamp | NULL | | deleted_by | int | NULL |

Ticket Category / Internal Group / Tags Table Structure

| Column Name | Type | Default | |-------------|-----------|------------| | id | integer | NOT NULL | | name | string | NOT NULL | | entity | enum | NOT NULL | | enabled | boolean | 1 |

Ticket Tags Pivot Table Structure

| Column Name | Type | Default | |-------------|-----------|------------| | id | int | NOT NULL | | ticket_id | int | NOT NULL | | tag_id | int | NOT NULL |

Usage

  • Create Ticket as User
$ticket = ticket()->createAsUser($userId, $ticketData)
  • Create Ticket as Entity
$ticket = ticket()->createAsEntity($entityId, $ticketData)
  • Interact With Ticket Status
$ticket->reOpen()
        ->open()
        ->archived()
  • Interact With Ticket Category
$ticket->setCategory($id)
        ->removeCategory()
  • Interact With Ticket Internal Group
$ticket->setInternalGroup($id)
        ->removeInternalGroup()
  • Interact With Ticket Tags
$ticket->attachTags([$tagId1,$tagId2,$tagId3])
       ->detachTags([$tagId1])
       ->syncTags([$tagId4, $tagId5, $tagId6])
  • Create Ticket Response
$reponse = $ticket->replyAsUser($userId, $responseData)

$reponse = $ticket->replyAsEntity($entityId, $responseData)
  • Interact with Response Message Type
$response->markAsInternalMessage()
         ->markAsExternalMessage()
  • Upload Documents on Responses
$response->attachDocuments($attachments, function (AttachmentRepository $repository) use ($uploads){
                $repository->upload($uploads, '/path/to/folder');
            })
  • Chainable Functions
$ticket = ticket()
            ->createAsUser($userId, $ticketData)
            ->setCategory($categoryId
            ->setInternalGroup($internalGroupId
            ->attachTags([$tagId1,$tagId2,$tagId3])
            ->detachTags([$tagId1])
            ->syncTags([$tagId4, $tagId5, $tagId6])
            ->reOpen()
            ->open()
            ->archived()
            ->replyAsUser($userId, $responseData)
            ->markAsInternalMessage()
            ->attachDocuments($attachments, function (AttachmentRepository $repository) use ($uploads){
                $repository->upload($uploads, '/path/to/folder');
            })
            ->getTicket();
  • A real Scenario
$ticket = ticket()
            ->createAsUser($userId, $ticketData)
            ->replyAsUser($userId, $responseData)
            ->markAsInternalMessage()
            ->attachDocuments($attachments, function (AttachmentRepository $repository) use ($uploads){
                $repository->upload($uploads, '/path/to/folder');
            })
            ->getTicket();

Testing

composer test
Comments