Ticket Relationship Methods
The ticket
model has also a list of methods for interacting with another related models
Method | Arguments | Description | Example |
---|---|---|---|
attachLabels |
mixed ID, array attributes, bool touch |
associate labels into an existing ticket | $ticket->attachLabels([1,2,3,4]) |
syncLabels |
Model/array IDs, bool detouching |
associate labels into an existing ticket | $ticket->syncLabels([1,2,3,4]) |
attachCategories |
mixed ID, array attributes, bool touch |
associate categories into an existing ticket | $ticket->attachCategories([1,2,3,4]) |
syncCategories |
Model/array IDs, bool detouching |
associate categories into an existing ticket | $ticket->syncCategories([1,2,3,4]) |
message |
string message |
add new message on an existing ticket | $ticket->message('A message in a ticket') |
messageAsUser |
Model/null user, string message |
add new message on an existing ticket as a different user | $ticket->messageAsUser($user, 'A message in a ticket') |
The
attachCategories
andsyncCategories
methods, is an alternative forattach
andsync
laravel methods, and if you want to learn more, please take a look at this link
The commentAsUser
accepts a user as a first argument, if it's null, the authenticated user will be user as default.