chore: streamline query builder orderBy calls with asc and desc arguments

This commit is contained in:
HDVinnie
2022-01-08 03:34:17 -05:00
parent 77ec35bea5
commit d7cb337f5f
26 changed files with 56 additions and 56 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ class Comment extends Model
public static function checkForStale(Ticket $ticket): void
{
if (empty($ticket->reminded_at) || \strtotime($ticket->reminded_at) < \strtotime('+ 3 days')) {
$last_comment = $ticket->comments()->orderBy('id', 'desc')->first();
$last_comment = $ticket->comments()->orderByDesc('id')->first();
if (\property_exists($last_comment, 'id') && $last_comment->id !== null && ! $last_comment->user->is_modo && \strtotime($last_comment->created_at) < \strtotime('- 3 days')) {
\event(new TicketWentStale($last_comment->ticket));