protected function getScopeCounts()
    {
        if ( ! $this->areScopesEnabled()) {
            return [];
        }

        $info = $this->getModelInformation();

        if ( ! $info->list->scopes || ! count($info->list->scopes)) {
            // @codeCoverageIgnoreStart
            return [];
            // @codeCoverageIgnoreEnd
        }

        $counts = [];

        $repository = $this->getModelRepository();

        foreach (array_keys($info->list->scopes) as $key) {

            $this->applyScope($repository, $key);

            $query = $this->getModelRepository()->query();

            $this->applyListParentToQuery($query);

            $counts[ $key ] = $query->count();
        }

        return $counts;
    }
protected function getScopeCounts()
    {
        if ( ! $this->areScopesEnabled()) {
            return [];
        }

        $info = $this->getModelInformation();

        if ( ! $info->list->scopes || ! count($info->list->scopes)) {
            // @codeCoverageIgnoreStart
            return [];
            // @codeCoverageIgnoreEnd
        }

        $counts = [];

        $repository = $this->getModelRepository();

        foreach (array_keys($info->list->scopes) as $key) {

            $this->applyScope($repository, $key);

            $query = $this->getModelRepository()->query();

            $this->applyListParentToQuery($query);

            $counts[ $key ] = $query->count();
        }

        return $counts;
    }
protected function getScopeCounts ( ) { if ( ! $ this -> areScopesEnabled ( ) ) { return [ ] ; } $ info = $ this -> getModelInformation ( ) ; if ( ! $ info -> list -> scopes || ! count ( $ info -> list -> scopes ) ) { // @codeCoverageIgnoreStart return [ ] ; // @codeCoverageIgnoreEnd } $ counts = [ ] ; $ repository = $ this -> getModelRepository ( ) ; foreach ( array_keys ( $ info -> list -> scopes ) as $ key ) { $ this -> applyScope ( $ repository , $ key ) ; $ query = $ this -> getModelRepository ( ) -> query ( ) ; $ this -> applyListParentToQuery ( $ query ) ; $ counts [ $ key ] = $ query -> count ( ) ; } return $ counts ; }
Returns total amount of matches for each available scope.

@return int[]    assoc, keyed by scope key
Returns total amount of matches for each available scope .