code: public function ancestorsAndSelf() {
      return $this->newNestedSetQuery()
                  ->where($this->getLeftColumnName(), '<=', $this->getLeft())
                  ->where($this->getRightColumnName(), '>=', $this->getRight());
    }
docs: Instance scope which targes all the ancestor chain nodes including
  the current one.
  
  @return \Illuminate\Database\Eloquent\Builder