src/Block.php
public function count($module)
    {

        if (User::hasRole('user')) {
            $this->block->pushCriteria(new \Litecms\Block\Repositories\Criteria\BlockUserCriteria());
        }

        if ($module == 'block') {
            return $this->block
                ->scopeQuery(function ($query) {
                    return $query;
                })
                ->count();
        }

        if ($module == 'category') {
            return $this->category
                ->scopeQuery(function ($query) {
                    return $query;
                })->count();
        }

        if ($module == 'public') {
            return $this->block
                ->pushCriteria(new \Litecms\Block\Repositories\Criteria\BlockPublicCriteria())
                ->scopeQuery(function ($query) {
                    return $query;
                })->count();
        }

    }
public function count($module)
    {

        if (User::hasRole('user')) {
            $this->block->pushCriteria(new \Litecms\Block\Repositories\Criteria\BlockUserCriteria());
        }

        if ($module == 'block') {
            return $this->block
                ->scopeQuery(function ($query) {
                    return $query;
                })
                ->count();
        }

        if ($module == 'category') {
            return $this->category
                ->scopeQuery(function ($query) {
                    return $query;
                })->count();
        }

        if ($module == 'public') {
            return $this->block
                ->pushCriteria(new \Litecms\Block\Repositories\Criteria\BlockPublicCriteria())
                ->scopeQuery(function ($query) {
                    return $query;
                })->count();
        }

    }
public function count ( $ module ) { if ( User :: hasRole ( 'user' ) ) { $ this -> block -> pushCriteria ( new \ Litecms \ Block \ Repositories \ Criteria \ BlockUserCriteria ( ) ) ; } if ( $ module == 'block' ) { return $ this -> block -> scopeQuery ( function ( $ query ) { return $ query ; } ) -> count ( ) ; } if ( $ module == 'category' ) { return $ this -> category -> scopeQuery ( function ( $ query ) { return $ query ; } ) -> count ( ) ; } if ( $ module == 'public' ) { return $ this -> block -> pushCriteria ( new \ Litecms \ Block \ Repositories \ Criteria \ BlockPublicCriteria ( ) ) -> scopeQuery ( function ( $ query ) { return $ query ; } ) -> count ( ) ; } }
Returns count of blog or category.

@param array $filter

@return int
Returns count of blog or category .