This method will not return Friendship models
It will return the 'friends' models. ex: App\User

@param int $perPage Number

@return \Illuminate\Database\Eloquent\Collection
507501
public function getMutualFriends(Model $other, $perPage = 0)
    {
        return $this->getOrPaginate($this->getMutualFriendsQueryBuilder($other), $perPage);
    }
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;
    }
570096
public function gadget($perpage = 10)
    {
        $data['pages'] = $this->model->paginate($perpage);

        return View::make('page::admin.page.gadget', $data);
    }
47788
public function paginate($perPage = null, $columns = array('*'))
	{
		$this->query->addSelect($this->getSelectColumns($columns));

		$paginator = $this->query->paginate($perPage, $columns);

		$this->hydratePivotRelation($paginator->items());

		return $paginator;
	}
999840
public function loadRelationsForPage(int $perPage, int $page = 1): self
    {
        foreach ($this->relations as $name => $constraints) {
            $this->loadRelationForPage($perPage, $page, $name, $constraints);
        }

        return $this;
    }
884411
public function paginate($perPage, $columns, $pageName, $page)
    {
        return $this->db->paginate($perPage, $columns, $pageName, $page);
    }
617616
public function getOrderedChildren($perPage = null)
    {
        $children = $this->children();

        $this->determineChildrenSorting($children);

        return $this->determineChildrenPagination($perPage, $children);
    }
180725
public function getAll($label = null, $page = 1, $perPage = 25)
    {
        $params = array(
            'page' => $page,
            'per_page' => $perPage
        );

        if ($label !== null) {
            $params['label'] = $label;
        }

        return $this->_user->get('account/identity', $params);
    }
1023214
public function setPagination($currentPage, $perPage = null)
    {

        $this->currentPageNumber = $this->isValidPageNumber($currentPage) ? $currentPage : 1;
        $defaultPerPage = $this->perPage ? $this->perPage : static::$perPageDefault;
        $this->perPage = $perPage ?: $defaultPerPage;
        $this->pages = null;
        return $this;
    }
1275742
public function paginate($perPage = null, $page = 1)
    {
        $this->paginated(true);

        $this->perPage = $perPage ?: $this->perPage;
        $this->page    = $page;

        return $this;
    }
280250
public function paginate($perPage = null, $pageName = 'page', $page = null)
    {
        $engine = $this->engine();

        $page = $page ?: Paginator::resolveCurrentPage($pageName);

        $perPage = $perPage ?: $this->model->getPerPage();

        $results = $this->model->newCollection($engine->map(
            $this, $rawResults = $engine->paginate($this, $perPage, $page), $this->model
        )->all());

        $paginator = (new LengthAwarePaginator($results, $engine->getTotalCount($rawResults), $perPage, $page, [
            'path' => Paginator::resolveCurrentPath(),
            'pageName' => $pageName,
        ]));

        return $paginator->appends('query', $this->query);
    }
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;
    }
1073202
protected function getNumberLinks($perPage, $startRowNumber, $startIndexNumber = 1)
    {
        $numberLinks = NULL;

        for( $i = $startIndexNumber; $i <= $perPage; $i++ )
        {
            $page = ($i - 1) * $this->limit;

            if( $i - 1 == floor((int) $startRowNumber / $this->limit) )
            {
                $currentLink = $this->getStyleClassAttributes('current');
            }
            else
            {
                $currentLink = $this->getStyleClassLinkAttributes('links');;
            }

            $numberLinks .= $this->getLink($page, $currentLink, $i);
        }

        return $numberLinks;
    }
346635
final public function page($pageNumber, $recordsPerPage = null)
    {
        $recordsPerPage = $recordsPerPage ?? $this->recordsPerPage;

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

        return $this;
    }
799234
public function paginate($perPage = null, $columns = array('*'))
	{
		$perPage = $perPage ?: $this->model->getPerPage();
		
		$paginator = $this->connection->getPaginator();
		
		$total = $this->getPaginationCount();
		
		return $paginator->make($this->get($columns)->all(), $total, $perPage);
	}
80182
public function findPages($type, $page, $numberPerPage)
    {
        $offset = (($page - 1) * $numberPerPage);

        return $this
            ->createQueryBuilder('p')
            ->where('p.enabled = :enabled')
            ->andWhere('p.type = :type')
            ->orderBy('p.publicationDate', 'DESC')
            ->setParameters([
                'enabled' => true,
                'type' => $type,
            ])
            ->setFirstResult($offset)
            ->setMaxResults($numberPerPage)
            ->getQuery()
            ->getArrayResult();
    }
807155
public function getPagedResults($limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_GET_USERS, User::class);

        return $this->getPaginator($dql, $limit, $page);
    }