protected function getCountPer($span, Carbon $from, Carbon $until = null, $locale = null, $query = null, $cacheKey = null)
    {
        $query = $this->determineLocaleAndQuery($locale, $query);

        $statistics = [];
        $labels = [];

        if (is_null($until))
        {
            $until = Carbon::now();
        }

        $until->{'startOf' . $span}();

        while ($until->gt($from))
        {
            $start = $until->copy();
            $end = $until->copy()->{'endOf' . $span}();

            $labels[] = $until->copy();
            $statistics[] = $this->getCountInBetween($start, $end, $locale, clone $query, $cacheKey);

            $until->{'sub' . $span}();
        }

        return [
            array_reverse($statistics),
            array_reverse($labels)
        ];
    }
protected function getCountPer($span, Carbon $from, Carbon $until = null, $locale = null, $query = null, $cacheKey = null)
    {
        $query = $this->determineLocaleAndQuery($locale, $query);

        $statistics = [];
        $labels = [];

        if (is_null($until))
        {
            $until = Carbon::now();
        }

        $until->{'startOf' . $span}();

        while ($until->gt($from))
        {
            $start = $until->copy();
            $end = $until->copy()->{'endOf' . $span}();

            $labels[] = $until->copy();
            $statistics[] = $this->getCountInBetween($start, $end, $locale, clone $query, $cacheKey);

            $until->{'sub' . $span}();
        }

        return [
            array_reverse($statistics),
            array_reverse($labels)
        ];
    }
protected function getCountPer ( $ span , Carbon $ from , Carbon $ until = null , $ locale = null , $ query = null , $ cacheKey = null ) { $ query = $ this -> determineLocaleAndQuery ( $ locale , $ query ) ; $ statistics = [ ] ; $ labels = [ ] ; if ( is_null ( $ until ) ) { $ until = Carbon :: now ( ) ; } $ until -> { 'startOf' . $ span } ( ) ; while ( $ until -> gt ( $ from ) ) { $ start = $ until -> copy ( ) ; $ end = $ until -> copy ( ) -> { 'endOf' . $ span } ( ) ; $ labels [ ] = $ until -> copy ( ) ; $ statistics [ ] = $ this -> getCountInBetween ( $ start , $ end , $ locale , clone $ query , $ cacheKey ) ; $ until -> { 'sub' . $ span } ( ) ; } return [ array_reverse ( $ statistics ) , array_reverse ( $ labels ) ] ; }
Gets count per timespan

@param string $span
@param Carbon $from
@param Carbon|null $until
@param string|null $locale
@param mixed $query
@param string|null $cacheKey
@return array
Gets count per timespan