Skip to content

Commit

Permalink
Refactor getLatest and getLatestWhere to use getCreatedAtColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
esbenp authored and Carghaez committed Jul 28, 2017
1 parent 95b0d3f commit da227be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function getLatest(array $options = [])
{
$query = $this->createBaseBuilder($options);

$query->orderBy('created_at', 'DESC');
$query->orderBy($this->getCreatedAtColumn(), 'DESC');

return $query->first();
}
Expand All @@ -108,7 +108,7 @@ public function getLatestWhere($column, $value, array $options = [])
{
$query = $this->createBaseBuilder($options);

$query->orderBy('created_at', 'DESC');
$query->orderBy($this->getCreatedAtColumn(), 'DESC');

return $query->first();
}
Expand Down

0 comments on commit da227be

Please sign in to comment.