Skip to content

Commit

Permalink
Fix error getRecentWhere and getLastestWhere
Browse files Browse the repository at this point in the history
  • Loading branch information
trinhphuong committed Sep 16, 2018
1 parent 66a53dc commit bc4e85f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public function getRecentWhere($column, $value, array $options = [])
{
$query = $this->createBaseBuilder($options);

$query->where($column, $value);

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

return $query->get();
Expand Down Expand Up @@ -109,6 +111,8 @@ public function getLatestWhere($column, $value, array $options = [])
{
$query = $this->createBaseBuilder($options);

$query->where($column, $value);

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

return $query->first();
Expand Down

0 comments on commit bc4e85f

Please sign in to comment.