public function setNullParent()
    {
        if ($this->hasParent()) {
            unset($this->parent->children);
        }
        unset($this->parent);
        $this->setParentId(static::$nullParent);
    }
public function setNullParent()
    {
        if ($this->hasParent()) {
            unset($this->parent->children);
        }
        unset($this->parent);
        $this->setParentId(static::$nullParent);
    }
public function setNullParent ( ) { if ( $ this -> hasParent ( ) ) { unset ( $ this -> parent -> children ) ; } unset ( $ this -> parent ) ; $ this -> setParentId ( static :: $ nullParent ) ; }
Set null parent.
This method would unset the lazy loading records before setting it.
Don't forget save model after setting it.
Set null parent . This method would unset the lazy loading records before setting it . Don t forget save model after setting it .