We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 18ee8ce + 53e4322 commit 4ed5217Copy full SHA for 4ed5217
src/Traits/WithSorting.php
@@ -58,7 +58,13 @@ public function applySorting($query)
58
$direction = 'desc';
59
}
60
61
- if (optional($this->getColumn($field))->hasSortCallback()) {
+ $column = $this->getColumn($field);
62
+
63
+ if (is_null($column)) {
64
+ continue;
65
+ }
66
67
+ if ($column->hasSortCallback()) {
68
$query = app()->call($this->getColumn($field)->getSortCallback(), ['query' => $query, 'direction' => $direction]);
69
} else {
70
$query->orderBy($field, $direction);
0 commit comments