You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://packagist.org/packages/coderflexx/laravel-ticket)
Before Running the migration, you may publish the config file, and make sure the current tables does not make a confilict with your existing application, and once you are happy with the migration table, you can run
| `markAsResolved` |`void` | mark the ticket as resolved | `$ticket->markAsResolved()` | ✓
139
+
| `markAsLocked` |`void` | mark the ticket as locked | `$ticket->markAsLocked()` | ✓
140
+
| `markAsUnlocked` |`void` | mark the ticket as unlocked | `$ticket->markAsUnlocked()` | ✓
141
+
| `markAsArchived` |`void` | mark the ticket as archived | `$ticket->markAsArchived()` | ✓
142
+
| `closeAsResolved` |`void` | close the ticket and marked it as resolved | `$ticket->closeAsResolved()` | ✓
143
+
| `closeAsUnresolved` |`void` | close the ticket and marked it as unresolved | `$ticket->closeAsUnresolved()` | ✓
144
+
| `reopenAsUnresolved` |`void` | reopen the ticket and marked it as unresolved | `$ticket->reopenAsUnresolved()` | ✓
145
+
| `isArchived` |`void` | check if the ticket archived | `$ticket->isArchived()` | ✗
146
+
| `isOpen` |`void` | check if the ticket open | `$ticket->isOpen()` | ✗
147
+
| `isClosed` |`void` | check if the ticket closed | `$ticket->isClosed()` | ✗
148
+
| `isResolved` |`void` | check if the ticket has a resolved status | `$ticket->isResolved()` | ✗
149
+
| `isUnresolved` |`void` | check if the ticket has a unresolved status | `$ticket->isUnresolved()` | ✗
150
+
| `isLocked` |`void` | check if the ticket is locked | `$ticket->isLocked()` | ✗
151
+
| `isUnlocked` |`void` | check if the ticket is unlocked | `$ticket->isUnlocked()` | ✗
152
+
153
+
The __Chainable__ column, is showing the state for the method, that if it can be chained or not, something like
154
+
```php
155
+
$ticket->archive()
156
+
->close()
157
+
->markAsResolved();
158
+
```
159
+
## Ticket Relashionship API Methods
160
+
The `ticket` model has also a list of methods for interacting with another related models
161
+
162
+
| Method | Arguments | Example | Description |
163
+
|---|---|---|---|
164
+
|`attachLabels`|`mixed` id, `array` attributes, `bool` touch | associate labels into an existing ticket |`$ticket->attachLabels([1,2,3,4])`|
165
+
|`syncLabels`|`Model|array` ids, `bool` detouching | associate labels into an existing ticket |`$ticket->syncLabels([1,2,3,4])`|
166
+
|`attachCategories`|`mixed` id, `array` attributes, `bool` touch | associate categories into an existing ticket |`$ticket->attachCategories([1,2,3,4])`|
167
+
|`syncCategories`|`Model|array` ids, `bool` detouching | associate categories into an existing ticket |`$ticket->syncCategories([1,2,3,4])`|
168
+
|`message`|`string` message | add new message on an existing ticket |`$ticket->message('A message in a ticket')`|
169
+
|`messageAsUser`|`Model|null` user, `string` message | add new message on an existing ticket as a deffrent user |`$ticket->messageAsUser($user, 'A message in a ticket')`|
170
+
171
+
> The `attachCategories` and `syncCategories` methods, is an alternative for `attach` and `sync` laravel methods, and if you want to learn more, please take a look at this [link](https://laravel.com/docs/9.x/eloquent-relationships#attaching-detaching)
172
+
173
+
The `commentAsUser` accepts a user as a first argument, if it's null, the __authenticated__ user will be user as default.
0 commit comments