Get tracks by flag range

@param int $min
@param int $max
@param int $trackableType
@param int $perPage
@return \Illuminate\Contracts\Pagination\LengthAwarePaginator
433202
public function getByFlagRange(int $min, int $max = Settings::FLAG_MAX, int $trackableType = Tracker::TRACKER_ANY, int $perPage = 15) : LengthAwarePaginator
    {
        $query = $this->getModel()->newQuery();

        if ($max === Settings::FLAG_MAX) {
            $query->where('level', '>=', $min);
        } else {
            $query->whereBetween('level', [$min, $max]);
        }

        $query->where($this->typeClosure($trackableType));

        return $query->paginate($perPage);
    }
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;
    }
1072895
public function forPage($page, $perPage = 15)
	{
		if( $page < 1 )
		{
			$page = 1;
		}
		return $this->limit($perPage, ($page - 1) * $perPage);
	}
805214
public function between($min, $max) {
        $this->check_role = 'between';
        $this->p1 = $min;
        $this->p2 = $max;
        $result = $this->value >= $min && $this->value <= $max;
        $this->checkResult($result);
        return $this;
    }
618851
public function aggregate($uuid, $page = 1, $maxPerPage = 25)
    {
        return $this->dataTransformer->transform(
            $this->paginateAggregate($this->eventQuery->fromAggregate($uuid), $page, $maxPerPage),
            $this->eventQuery->streamCount($uuid),
            $page,
            $maxPerPage
        );
    }
273089
public function paginateRaw($perPage = null, $pageName = 'page', $page = null)
    {
        $engine = $this->engine();

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

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

        $results = $engine->paginate($this, $perPage, $page);

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

        return $paginator->appends('query', $this->query);
    }
207153
public function vLimit(Int $min = 0, Int $max = NULL)
    {
        $key['minchar'] = [':p1' => $min];
        $typ['minchar'] = $min;

        if( $max !== NULL )
        {
            $key['maxchar'] = [':p1' => $max];
            $typ['maxchar'] = $max;
        }

        return $this->onInvalidEventPattern('.{' . $min . ',' . $max . '}', $key, [], $typ);
    }
157104
public function paginate(int $page = 1, int $perPage = 25) : self
    {
        return $this->limit($perPage, ($page - 1) * $perPage);
    }
1064054
public function length($min, $max = null) {
        if (!$this->_isValid) {
            return $this;
        }
        $length = mb_strlen($this->_unsafeVar, $this->conf['encoding']);
        if ($length < $min || (!is_null($max) && $length > $max)) {
            $this->_isValid = false;
        }
        return $this;
    }
505103
public function countArray($min, $max = PHP_INT_MAX)
    {
        return $this->markErrorIf(!is_array($this->value)||count($this->value) < $min || count($this->value) > $max, false);
    }
595956
public function paginate($page = 1, $perPage = 15)
    {
        if ($this->paginatorCreator) {
            return call_user_func($this->paginatorCreator, $page, $perPage);
        }

        $all = iterator_to_array($this->getIterator());

        return array_slice($all, ($page-1)*$perPage, $perPage);
    }
617616
public function getOrderedChildren($perPage = null)
    {
        $children = $this->children();

        $this->determineChildrenSorting($children);

        return $this->determineChildrenPagination($perPage, $children);
    }
279529
public function range($min, $max, $steps = 1, $round = 0) {

        if(false === is_numeric($min)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type float or integer, "%s" given', __METHOD__, gettype($min)), E_USER_ERROR);
        }

        if(false === is_numeric($max)) {
            return trigger_error(sprintf('Argument 2 passed to %s() must be of the type float or integer, "%s" given', __METHOD__, gettype($max)), E_USER_ERROR);
        }

        if(false === is_numeric($steps)) {
            return trigger_error(sprintf('Argument 3 passed to %s() must be of the type float or integer, "%s" given', __METHOD__, gettype($steps)), E_USER_ERROR);
        }

        if(false === ('-' . intval($round) == '-' . $round)) {
            return trigger_error(sprintf('Argument 4 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($round)), E_USER_ERROR);
        }

        $this -> min    = $min;
        $this -> max    = $max;
        $this -> steps  = $steps;
        $this -> round  = $round;

        return $this;
    }
504024
protected function getVerifiedCount($count, $min = 1, $max = 100)
    {
        settype($count, "integer");
        settype($min, "integer");
        settype($max, "integer");

        // If $min is greater than $max,
        // use the smallest of the two ($max)
        if ($min > $max) $min = $max;

        if ($count < $min)
        {
            $count = $min;
        }
        elseif ($count > $max)
        {
            $count = $max;
        }

        return $count;
    }
1164908
public static function numberLimit($val, $min, $max)
    {
        return ($val > $min ? ($val < $max ? $val : $max) : $min);
    }
137349
protected function getPage($records, $maxshown, $numpages) {
        $show = floor($numpages / 2);
        if (self::$lastpage > $numpages) {
            self::$page = (self::$current > $show ? (self::$current - $show) : 1);
            if (self::$current < (self::$lastpage - $show)) {
                self::$lastpage = ((self::$current <= $show) ? (self::$current + ($numpages - self::$current)) : (self::$current + $show));
            }
            else { self::$page = self::$current - ($numpages - ((ceil(intval($records) / ($maxshown >= 1 ? intval($maxshown) : 1)) - self::$current)) - 1); }
        }
        else { self::$page = 1; }
    }
981716
public static function limit($number, $min, $max): int
    {
        return self::max(self::min($number, $min), $max);
    }