Skip to content

Commit

Permalink
Merge pull request #1062 from ktecho/patch-2
Browse files Browse the repository at this point in the history
Improve ordering by activity date
  • Loading branch information
lcharette authored Jan 31, 2020
2 parents af96185 + 7b91894 commit 123ee0b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/sprinkles/admin/src/Sprunje/ActivitySprunje.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,20 @@ protected function sortUser($query, $direction)

return $this;
}

/**
* Sort based on activity occurred_at.
*
* @param Builder $query
* @param string $direction
*
* @return self
*/
protected function sortOccurredAt($query, $direction)
{
$query->orderBy('activities.occurred_at', $direction)
->orderby('activities.id', $direction);

return $this;
}
}

0 comments on commit 123ee0b

Please sign in to comment.