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.
1 parent 7df7c00 commit 74fdc2fCopy full SHA for 74fdc2f
src/Traits/WithSorting.php
@@ -54,7 +54,14 @@ public function applySorting($query)
54
}
55
56
foreach ($this->sorts as $field => $direction) {
57
- if (optional($this->getColumn($field))->hasSortCallback()) {
+
58
+ $column = $this->getColumn($field);
59
60
+ if (is_null($column)) {
61
+ continue;
62
+ }
63
64
+ if (optional($column)->hasSortCallback()) {
65
$query = app()->call($this->getColumn($field)->getSortCallback(), ['query' => $query, 'direction' => $direction]);
66
} else {
67
$query->orderBy($field, $direction);
0 commit comments