Skip to content

Commit

Permalink
Update FunctionsTrait.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Gevor701069 authored Aug 4, 2020
1 parent 567e793 commit 07da7c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Traits/FunctionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace LaraServiceModel\Traits;

use LaraSupport\Facades\LaraDB;
use Illuminate\Support\Facades\Schema;

/**
* Trait Functions
Expand Down Expand Up @@ -66,7 +67,7 @@ protected function setSortingOptions($options = [], $group = self::GROUP)
*/
protected function getSortableColumns($column = null, $group = self::GROUP)
{
return $this->query->getModel()->getSortable($column, $group);
return Schema::hasColumn($this->baseModel->getTable(), $column) && $this->query->getModel()->getSortable($column, $group);
}

/**
Expand Down

0 comments on commit 07da7c2

Please sign in to comment.