Skip to content

Commit c0d593b

Browse files
committed
adding methods to interact with ticket priority and updating the readme file
the functions: makePriorityAsLow(): self makePriorityAsNormal(): self makePriorityAsHigh(): self
1 parent e127a70 commit c0d593b

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ The `ticket` model came with handy methods to use, to make your building process
214214
| `isLocked` |`void` | check if the ticket is locked | `$ticket->isLocked()` | ✗
215215
| `isUnlocked` |`void` | check if the ticket is unlocked | `$ticket->isUnlocked()` | ✗
216216
| `assignTo` |`void` | assign ticket to a user | `$ticket->assignTo($user)` or `$ticket->assignTo(2)` | ✓
217+
| `makePriorityAsLow` |`void` | make ticket priority as low | `$ticket->makePriorityAsLow()` | ✓
218+
| `makePriorityAsNormal`|`void`| make ticket priority as normal | `$ticket->makePriorityAsNormal()` | ✓
219+
| `makePriorityAsHigh` |`void` | make ticket priority as high | `$ticket->makePriorityAsHigh()` | ✓
217220

218221
The __Chainable__ column, is showing the state for the method, that if it can be chained or not, something like
219222
```php

src/Concerns/InteractsWithTickets.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,31 @@ public function assignTo(Model|int $user): self
195195

196196
return $this;
197197
}
198+
199+
/**
200+
* make ticket priority as low
201+
*/
202+
public function makePriorityAsLow(): self
203+
{
204+
$this->update(['priority' => Priority::LOW->value]);
205+
return $this;
206+
}
207+
208+
/**
209+
* make ticket priority as normal
210+
*/
211+
public function makePriorityAsNormal(): self
212+
{
213+
$this->update(['priority' => Priority::NORMAL->value]);
214+
return $this;
215+
}
216+
217+
/**
218+
* make ticket priority as high
219+
*/
220+
public function makePriorityAsHigh(): self
221+
{
222+
$this->update(['priority' => Priority::HIGH->value]);
223+
return $this;
224+
}
198225
}

0 commit comments

Comments
 (0)