OpenSkill\Datatable\Providers\CollectionProvider::sortCollection PHP Method

sortCollection() private method

Most tables only support the ordering by just one column, but we will enable sorting on all columns here
private sortCollection ( )
    private function sortCollection()
    {
        if ($this->queryConfiguration->hasOrderColumn()) {
            $order = $this->queryConfiguration->orderColumns();
            $orderFunc = $this->defaultGlobalOrderFunction;
            $this->collection = $this->collection->sort(function ($first, $second) use($order, $orderFunc) {
                return $orderFunc($first, $second, $order);
            });
        }
    }