public function getDescendants()
    {
        $descendants = $this->children;

        foreach ($this->children as $child) {
            $descendants = $descendants->merge($child->getDescendants());
        }

        return $descendants;
    }
public function getDescendants()
    {
        $descendants = $this->children;

        foreach ($this->children as $child) {
            $descendants = $descendants->merge($child->getDescendants());
        }

        return $descendants;
    }
public function getDescendants ( ) { $ descendants = $ this -> children ; foreach ( $ this -> children as $ child ) { $ descendants = $ descendants -> merge ( $ child -> getDescendants ( ) ) ; } return $ descendants ; }
Recursively build collection of descendant category IDs.

@return \Illuminate\Support\Collection
Recursively build collection of descendant category IDs .