public function count($type = 'admin.web')
    {

        return $this->calendar
            ->scopeQuery(function ($query) use ($type) {
                return $query->where('status', '<>', 'Draft')
                    ->whereUserId(user_id($type))
                    ->whereUserType(user_type($type));
            })->count();
    }
public function count($type = 'admin.web')
    {

        return $this->calendar
            ->scopeQuery(function ($query) use ($type) {
                return $query->where('status', '<>', 'Draft')
                    ->whereUserId(user_id($type))
                    ->whereUserType(user_type($type));
            })->count();
    }
public function count ( $ type = 'admin.web' ) { return $ this -> calendar -> scopeQuery ( function ( $ query ) use ( $ type ) { return $ query -> where ( 'status' , '<>' , 'Draft' ) -> whereUserId ( user_id ( $ type ) ) -> whereUserType ( user_type ( $ type ) ) ; } ) -> count ( ) ; }
Returns count of calendar.

@param array $filter

@return int
Returns count of calendar .