Skip to content

Commit 4ed5217

Browse files
committed
Merge branch 'lloricode-bugfix/invalid-column' into develop
# Conflicts: # src/Traits/WithSorting.php
2 parents 18ee8ce + 53e4322 commit 4ed5217

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Traits/WithSorting.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ public function applySorting($query)
5858
$direction = 'desc';
5959
}
6060

61-
if (optional($this->getColumn($field))->hasSortCallback()) {
61+
$column = $this->getColumn($field);
62+
63+
if (is_null($column)) {
64+
continue;
65+
}
66+
67+
if ($column->hasSortCallback()) {
6268
$query = app()->call($this->getColumn($field)->getSortCallback(), ['query' => $query, 'direction' => $direction]);
6369
} else {
6470
$query->orderBy($field, $direction);

0 commit comments

Comments
 (0)