Skip to content

Commit dbb7b8d

Browse files
committed
Use getOrderable() internally too
1 parent 8aacc20 commit dbb7b8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Repositories/AbstractRepository.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ public function findWhere(array $where, $columns = ['*'])
288288
public function orderBy($column, $direction)
289289
{
290290
// Ensure the sort is valid
291-
if (in_array($column, $this->orderable) === false
292-
&& array_key_exists($column, $this->orderable) === false
291+
if (in_array($column, $this->getOrderable()) === false
292+
&& array_key_exists($column, $this->getOrderable()) === false
293293
) {
294294
return $this;
295295
}
@@ -303,7 +303,7 @@ public function orderBy($column, $direction)
303303
$direction = in_array(strtolower($direction), ['desc', 'asc']) ? $direction : 'asc';
304304

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

308308
return $query->orderBy($this->appendTableName($column), $direction);
309309
});

0 commit comments

Comments
 (0)