Encore\Admin\Grid\Model::setSort PHP Method

setSort() protected method

Set the grid sort.
protected setSort ( ) : void
return void
    protected function setSort()
    {
        $this->sort = Input::get('_sort', []);
        if (!is_array($this->sort)) {
            return;
        }
        if (empty($this->sort['column']) || empty($this->sort['type'])) {
            return;
        }
        if (str_contains($this->sort['column'], '.')) {
            $this->setRelationSort($this->sort['column']);
        } else {
            $this->queries->push(['method' => 'orderBy', 'arguments' => [$this->sort['column'], $this->sort['type']]]);
        }
    }