Build a paginator instance from a raw result array.

@param  \Fly\Pagination\Environment  $paginator
@param  array  $results
@param  int    $perPage
@return \Fly\Pagination\Paginator
356843
public function buildRawPaginator($paginator, $results, $perPage)
	{
		// For queries which have a group by, we will actually retrieve the entire set
		// of rows from the table and "slice" them via PHP. This is inefficient and
		// the developer must be aware of this behavior; however, it's an option.
		$start = ($paginator->getCurrentPage() - 1) * $perPage;

		$sliced = array_slice($results, $start, $perPage);

		return $paginator->make($sliced, count($results), $perPage);
	}
1225562
public function paginate($perPage = 20)
    {
        $page = request()->get('page', 1);
        $path = request()->url();

        return new LengthAwarePaginator(
            $this->forPage($page, $perPage),
            $this->count(),
            $perPage,
            $page,
            compact('path')
        );
    }
1116175
public function paginate(Builder $builder, $perPage, $page)
    {
        $results = $this->performSearch($builder);

        if ($builder->limit) {
            $results['hits'] = $builder->limit;
        }

        $chunks = array_chunk($results['ids'], $perPage);

        if (! empty($chunks)) {
            if (array_key_exists($page - 1, $chunks)) {
                $results['ids'] = $chunks[$page - 1];
            } else {
                $results['ids'] = end($chunks);
            }
        }

        return $results;
    }
607615
public function paginate($page, $perPage = null)
    {
        if ($page < 1) {
            $page = 1;
        }
        
        $paginator = new Paginator($this->select, $this->adapter());
        $items     = $paginator->getItems(($page - 1) * $perPage, $perPage);
        
        return $items->toArray();
    }
1034126
public function paginate($per_page = 10, $page_name = "page", $page = null)
    {

        $this->take($per_page);

        $page = $page ?: Request::get($page_name, 1);

        $this->skip(($page * $per_page) - $per_page);

        $objects = $this->get();

        return new Pagination($objects, $objects->total, $per_page, $page, ['path' => Request::url(), 'query' => Request::query()]);
    }
346635
final public function page($pageNumber, $recordsPerPage = null)
    {
        $recordsPerPage = $recordsPerPage ?? $this->recordsPerPage;

        $this->getQuery()->limit(((int)$pageNumber) * $recordsPerPage, $recordsPerPage);
        $this->pagedQuery = true;

        return $this;
    }
1312722
public function scopePaginateFilter($query, $perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $perPage = $perPage ?: config('eloquentfilter.paginate_limit');
        $paginator = $query->paginate($perPage, $columns, $pageName, $page);
        $paginator->appends($this->filtered);

        return $paginator;
    }
884411
public function paginate($perPage, $columns, $pageName, $page)
    {
        return $this->db->paginate($perPage, $columns, $pageName, $page);
    }
280423
private function processPaginatedResults($pages, $perPage = 50, $currentPage = 0)
    {
        // Make sure we have at least one page of results
        if (count($pages) > 0) {
            $objects = [];

            // Go through each page
            foreach ($pages as $results) {
                // Get the entries for each page
                $entries = $this->connection->getEntries($results);

                /*
                 * If we've retrieved entries, we'll go through
                 * each and construct the entry attributes, and
                 * put them all inside the objects array
                 */
                if (is_array($entries) && array_key_exists('count', $entries)) {
                    for ($i = 0; $i < $entries['count']; $i++) {
                        $entry = $this->newLdapEntry($entries[$i], $this->connection);

                        $objects[] = $entry->getAttributes();
                    }
                }
            }

            /*
             * If we're sorting, we'll process all of
             * our results so it's sorted correctly
             */
            if (!empty($this->sortByField)) {
                $objects = $this->processSortBy($objects);
            }

            // Return a new Paginator instance
            return $this->newPaginator($objects, $perPage, $currentPage, count($pages));
        }

        // Looks like we don't have any results, return false
        return false;
    }
944868
public static function paginated($perPage, $item = [], $options = [], $query = null)
    {
        $request = new Request();

        if (is_null($query)) {
            $query = 'page';
        }

        if (!count($item)) {
            $item = static::all();
        }

        $currentPage = $request->input($query, null);
        if (is_null($currentPage)) {
            $currentPage = 1;
        }

        $collection = new Collection($item);
        $currentPageResults = $collection->slice(($currentPage - 1) * $perPage, $perPage)->all();

        if (!isset($options['path'])) {
            $options['path'] = $request->path();
        }

        return new Paginator(
            $currentPageResults, count($collection), $perPage, $currentPage, $options
        );
    }
1070247
public function paginate(Model $model, $per_page = 15, array $filters = [], array $columns = ['*'])
    {
        $this->onlyTrashed($model);
        $this->model = $this->relation->apply($this->model, $this);
        $this->model = $this->filter->apply($this->model, $this, $filters);

        return $this->model->order()->paginate($per_page, $columns)->toArray();
    }
115105
public function paginate(Builder $builder, $perPage, $page)
    {
        return $this->performSearch($builder, [
            'numericFilters' => $this->filters($builder),
            'hitsPerPage' => $perPage,
            'page' => $page - 1,
        ]);
    }
773323
public function paginate($perPage = 10, array $columns = ['*'], $pageName = 'page', $page = null)
    {
        $this->applyCriteria();

        return $this->model->paginate($perPage, $columns, $pageName, $page);
    }
467651
public function invoke(FilterableServiceInterface $service, $perPageCount, array $parameters = array())
    {
        $page = $this->getPageNumber();
        $sort = $this->getSortingColumn();
        $desc = $this->getDesc();

        $records = $service->filter($this->getData(), $page, $perPageCount, $sort, $desc, $parameters);

        // Tweak pagination if available
        if (method_exists($service, 'getPaginator')) {
            $paginator = $service->getPaginator();

            if ($paginator instanceof PaginatorInterface) {
                $paginator->setUrl($this->getPaginationUrl($page, $sort, $desc));
            }
        }

        return $records;
    }
585847
public function processPaginated(array $pages = [], $perPage = 50, $currentPage = 0)
    {
        $models = [];

        foreach ($pages as $results) {
            // Go through each page and process the results into an objects array.
            $models = array_merge($models, $this->process($results));
        }

        $models = $this->processSort($models)->toArray();

        return $this->newPaginator($models, $perPage, $currentPage, count($pages));
    }
800969
public function paginate(Builder $builder, $perPage, $page)
    {
        $builder->limit = $perPage;
        $builder->offset = ($perPage * $page) - $perPage;

        return $this->search($builder);
    }
34601
public function pagination($perPage = 15)
    {

        $currentPageFinder = Paginator::getCurrentPageFinder();
        $pathFinder = Paginator::getRequestPathFinder();


        $pagination = new Paginator($perPage, call_user_func($currentPageFinder), [
            'pageName' => 'page',
            'path' => call_user_func($pathFinder),
        ]);

        $pagination->setMode(Paginator::MODE_STANDART);
        $count = $this->build()->rowCount();

        $pagination->count($count);

        return $pagination;
    }