Skip to content

Commit

Permalink
Use getOrderable() internally too
Browse files Browse the repository at this point in the history
  • Loading branch information
Torann committed Feb 25, 2020
1 parent 8aacc20 commit dbb7b8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Repositories/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ public function findWhere(array $where, $columns = ['*'])
public function orderBy($column, $direction)
{
// Ensure the sort is valid
if (in_array($column, $this->orderable) === false
&& array_key_exists($column, $this->orderable) === false
if (in_array($column, $this->getOrderable()) === false
&& array_key_exists($column, $this->getOrderable()) === false
) {
return $this;
}
Expand All @@ -303,7 +303,7 @@ public function orderBy($column, $direction)
$direction = in_array(strtolower($direction), ['desc', 'asc']) ? $direction : 'asc';

// Check for table column mask
$column = Arr::get($this->orderable, $column, $column);
$column = Arr::get($this->getOrderable(), $column, $column);

return $query->orderBy($this->appendTableName($column), $direction);
});
Expand Down

0 comments on commit dbb7b8d

Please sign in to comment.