public function count($type='admin.web')
    {
        return $this->task->scopeQuery(function($query)use($type){
                return $query->whereUserId(user_id($type))
                            ->whereUserType(user_type($type));
            })->count();
    }
public function count($type='admin.web')
    {
        return $this->task->scopeQuery(function($query)use($type){
                return $query->whereUserId(user_id($type))
                            ->whereUserType(user_type($type));
            })->count();
    }
public function count ( $ type = 'admin.web' ) { return $ this -> task -> scopeQuery ( function ( $ query ) use ( $ type ) { return $ query -> whereUserId ( user_id ( $ type ) ) -> whereUserType ( user_type ( $ type ) ) ; } ) -> count ( ) ; }
Returns count of tasks.

@param array $filter

@return int
Returns count of tasks .