Msieprawski\ResourceTable\Generators\Collection::_getPaginatorPresenter PHP Method

_getPaginatorPresenter() private method

Returns Paginator Presenter object if pagination is enabled
private _getPaginatorPresenter ( array $items ) : mixed
$items array
return mixed
    private function _getPaginatorPresenter(array $items)
    {
        if (!$this->_paginate) {
            return null;
        }
        $params = Input::get();
        if (!empty($params)) {
            // There are parameters in the URL - pass them to paginator
            if (isset($params['page'])) {
                // We don't need that - paginator will add new one
                unset($params['page']);
            }
        }
        // Prepare paginator and pass it to presenter
        $paginator = new LengthAwarePaginator($items, $this->_totalItems, $this->_perPage, $this->_page, ['path' => Request::url()]);
        $paginator->appends($params);
        return new $this->_paginationPresenter($paginator);
    }