Get tracks by flag level

@param int $level
@param int $trackableType
@param int $perPage
@return \Illuminate\Contracts\Pagination\LengthAwarePaginator
968046
public function getByFlagLevel(int $level, int $trackableType = Tracker::TRACKER_ANY, int $perPage = 15) : LengthAwarePaginator
    {
        return $this->getModel()
                    ->newQuery()
                    ->where('level', $level)
                    ->where($this->typeClosure($trackableType))
                    ->paginate($perPage);
    }
1041954
protected function paginate($keys, $page, $perPage)
    {
        return new LengthAwarePaginator(
            $this->chunk($keys, $page, $perPage),
            count($keys),
            20,
            $page,
            [
                'path' => Paginator::resolveCurrentPath(),
                'pageName' => 'page',
            ]
        );
    }
783188
public function determineChildrenPagination($perPage, HasMany $children)
    {
        if ($perPage === false)
        {
            return $children;
        }

        return is_null($perPage) ?
            $children->get() :
            $children->paginate($perPage);
    }
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;
    }
202930
public function paginate($perPage = null, $columns = array('*'))
	{
		$perPage = $perPage ?: $this->model->getPerPage();

		$paginator = $this->query->getConnection()->getPaginator();

		if (isset($this->query->groups))
		{
			return $this->groupedPaginate($paginator, $perPage, $columns);
		}
		else
		{
			return $this->ungroupedPaginate($paginator, $perPage, $columns);
		}
	}
1260110
public function paginate($perPage, $page = null)
    {
        if (empty($page)) {
            $page = request('page', 1);
        }
        $offset = ($page * $perPage) - $perPage;

        $collection = $this->all();
        $newItems = array_slice($collection, $offset, $perPage, true);
        return $this->createChildCollection($newItems);
    }
1126290
static public function paginate($page, $per_page)
    {
        $query = self::createRelation();
        return $query->paginate($page, $per_page);
    }
986934
public function trackPage($page = null, $title = null, $hittype = null)
    {
        $allowedHitTypes = ['pageview', 'appview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'];
        if ($hittype === null) {
            $hittype = $allowedHitTypes[0];
        }

        if (!in_array($hittype, $allowedHitTypes)) {
            return;
        }

        $trackingCode = "ga('send', 'pageview');";

        if ($page !== null || $title !== null || $hittype !== null) {
            $page = ($page === null) ? "window.location.protocol + '//' + window.location.hostname + window.location.pathname + window.location.search" : "'{$page}'";
            $title = ($title === null) ? "document.title" : "'{$title}'";

            $trackingCode = "ga('send', {'hitType': '{$hittype}', 'page': {$page}, 'title': {$title}});";
        }

        $this->trackingBag->add($trackingCode);
    }
642418
public function forPage(int $page, int $perPage)
    {
        return $this->slice(($page - 1) * $perPage, $perPage);
    }
880021
public function paginate($page, $per_page=10) {
		$this->page = $page = $page ? $page:1;
		$this->per_page = $per_page;
		$this->offset(($page-1)*$per_page);
		$this->limit($per_page);

		return $this;
	}
922331
public function paginate(int $perPage = 15, array $columns = ['*'], $pageName = 'page', int $page = 0): LengthAwarePaginator
    {
        $paginate = $this->queryRelate->getQuery()->paginate($perPage, $columns, $pageName, $page);

        $this->resetQueryRelate();

        return $paginate;
    }
914629
public function getByIpv4($ip, int $trackableType = Tracker::TRACKER_ANY, int $perPage = 15) : LengthAwarePaginator
    {
        return $this->getModel()
                    ->newQuery()
                    ->where('ipv4', $this->getLongIp($ip))
                    ->where($this->typeClosure($trackableType))
                    ->paginate($perPage);
    }
1372396
public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $page = $page ?: Paginator::resolveCurrentPage($pageName);

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

        // Next we will set the limit and offset for this query so that when we get the
        // results we get the proper section of results. Then, we'll create the full
        // paginator instances for these results with the given page and per page.
        $this->skip(($page - 1) * $perPage)->take($perPage + 1);

        return $this->simplePaginator($this->get($columns), $perPage, $page, [
            'path' => Paginator::resolveCurrentPath(),
            'pageName' => $pageName,
        ]);
    }
616799
public function paginate($perPage = 30)
    {
        $page      = request()->input('page', 1);
        $items     = $this->slice(($page * $perPage) - $perPage, $perPage, true);
        $paginator = new LengthAwarePaginator($items, $this->count(), $perPage, $page);

        $paginator->setPath(request()->url());

        return $paginator;
    }
1258093
public function paginate($page, $per_page = 50) 
    {
        $this->_builder->limit  = $per_page;
        $this->_builder->offset = ($page - 1) * $per_page;
        $this->page             = $page;
        $this->per_page         = $per_page;

        if (Driver::$pagination_subquery) {
            $this->_builder->limit   = $this->_builder->offset + $per_page;
            $this->_builder->offset  = $this->_builder->offset + 1;
        }
        return $this;
    }
1139748
public function getPublishedPositionOrderedChildren($perPage = null)
    {
        $children = $this->children()
            ->published()
            ->defaultOrder();

        return $this->determineChildrenPagination($perPage, $children);
    }
773323
public function paginate($perPage = 10, array $columns = ['*'], $pageName = 'page', $page = null)
    {
        $this->applyCriteria();

        return $this->model->paginate($perPage, $columns, $pageName, $page);
    }