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);
    }
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);
    }
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 ) ; }
Get tracks by flag range

@param int $min
@param int $max
@param int $trackableType
@param int $perPage
@return \Illuminate\Contracts\Pagination\LengthAwarePaginator
Get tracks by flag range