Download the PHP package saasplayground/support-tickets without Composer
On this page you can find all versions of the php package saasplayground/support-tickets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saasplayground/support-tickets
More information about saasplayground/support-tickets
Files in saasplayground/support-tickets
Package support-tickets
Short Description Support tickets for your laravel app
License GPL-2.0-or-later
Homepage https://github.com/saasplayground/support-tickets
Informations about the package support-tickets
API first Support Tickets for Laravel App
Support Tickets package with API first approach. It provides a simple and easy API to add support tickets to your Laravel app. Supports Laravel 8 and above.
Installation
You can install the package via composer:
Then publish config
file:
Finally run the migrate command:
Usage
User Setup and API
To enable users to open tickets, add InteractsWithTickets
trait to your User
model.
InteractsWithTickets Methods
openTicket
: Open a new support ticket.postMessageOnTicket
: Post a new message on an existing ticket.tickets
: Gets tickets owned by user. Query builder methods can be chained on it.
openTicket Method: Ticket
Returns an instance of
Ticket
model.
Expects the following parameters:
data
: An array containing title, message, priority, sourcerelations
: (Optional) An array of relationships; Support for addinglabels
,categories
postMessageOnTicket Method: Ticket
Returns an instance of
Ticket
model.
Expects following parameters:
ticket
: The ticket modelmessage
: The message to be posteduser
: (Optional) Theid
ormodel
of user that will be attached to message
Tickets Setup and API
By default the Ticket
model does not need any setup, but if you are extending it, be sure
to update the corresponding value under models
in config file.
Ticket Model Methods
syncCategories
: Handles adding and deleting of entity categories.addCategories
: Add categories to the entity.detachCategories
: Removes given categories from entity.categories
: The categories that belong to the model. Query builder methods can be chained on it.syncLabels
: Handles adding and deleting of entity labels.addLabels
: Add labels to the entity.detachLabels
: Removes given labels from entity.labels
: The labels that belong to the model. Query builder methods can be chained on it.addMessage
: Add message to the entity.detachMessages
: Removes a set of messages or all messages from entity.messages
: The messages that belong to the model. Query builder methods can be chained on it.postMessageAsAgent
: Posts a message as agent.assignAgent
: Assigns an agent to the ticket.
syncCategories: void
Expects the following parameters:
categories
: An array of ids, int, or collection (model instances)
addCategories: void
Expects the following parameters:
categories
: An array of ids, int, or collection (model instances)
detachCategories: void
Expects the following parameters:
categories
: An array of ids, int, or collection (model instances)
categories: Collection
Returns a collection of or query builder instance of
Category
model.
syncLabels: void
Expects the following parameters:
labels
: An array of ids, int, or collection (model instances)
addLabels: void
Expects the following parameters:
labels
: An array of ids, int, or collection (model instances)
detachLabels: void
Expects the following parameters:
labels
: An array of ids, int, or collection (model instances)
labels: Collection
Returns a collection of or query builder instance of
Label
model.
addMessage: false
or Message
Returns false if user cannot be resolved or message cannot be created, else an instance of Message Model
Expects the following parameters:
body
: Astring
containing the messageuser
: (Optional) A userid
,Model
ornull
(when null default value is the ticket's user id)
detachMessages: void
Expects the following parameters:
messages
: (Optional) An array of ids, model id, or collection (model instances);
Deletes all messages when no value passed.
messages: Collection
Returns a collection of or query builder instance of
Message
model.
postMessageAsAgent: false
or Message
Returns false if user cannot be resolved or message cannot be created, else an instance of Message Model
Expects the following parameters:
message
: Astring
containing the message body
assignAgent: false
or Ticket
Returns false if user cannot be resolved, else an instance of
Ticket
model to chain more operations.
Expects the following parameters:
value
:int
orUser
model instance.
Configuration
See the published support-tickets
config file for available options.
Note: When modifying the config file, ensure the users
, tables
and models
values are always set.
Most of the default setup is set to match the basic Laravel app structure, hence there is no need to modify the config file heavily.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Cuthbert Mirambo
- All Contributors
License
The GNU GPLv3. Please see License File for more information.
All versions of support-tickets with dependencies
cviebrock/eloquent-sluggable Version ^9.0|^10.0
kalnoy/nestedset Version ^6.0
illuminate/database Version >=8.0
illuminate/events Version >=8.0
illuminate/http Version >=8.0
illuminate/support Version >=8.0
miracuthbert/laravel-eloquent-filters Version ^1.3
spatie/laravel-medialibrary Version >=8.0