Skip to content

Commit 5268a79

Browse files
authored
Update FunctionsTrait.php
1 parent 3ec29ea commit 5268a79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Traits/FunctionsTrait.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace LaraServiceModel\Traits;
44

55
use LaraSupport\Facades\LaraDB;
6+
use Illuminate\Support\Facades\Schema;
67

78
/**
89
* Trait Functions
@@ -66,7 +67,7 @@ protected function setSortingOptions($options = [], $group = self::GROUP)
6667
*/
6768
protected function getSortableColumns($column = null, $group = self::GROUP)
6869
{
69-
return $this->query->getModel()->getSortable($column, $group);
70+
return Schema::hasColumn($this->baseModel->getTable(), $column) && $this->query->getModel()->getSortable($column, $group);
7071
}
7172

7273
/**

0 commit comments

Comments
 (0)