src/Models/Term.php
function getParentSlugs(Taxonomy $taxonomy, $parameters = [])
    {
        array_push($parameters, $taxonomy->term->slug);

        if (($parents = $taxonomy->parent()) && ($parent = $parents->first()))
            return $this->getParentSlugs($parent, $parameters);

        return $parameters;
    }
function getParentSlugs(Taxonomy $taxonomy, $parameters = [])
    {
        array_push($parameters, $taxonomy->term->slug);

        if (($parents = $taxonomy->parent()) && ($parent = $parents->first()))
            return $this->getParentSlugs($parent, $parameters);

        return $parameters;
    }
function getParentSlugs ( Taxonomy $ taxonomy , $ parameters = [ ] ) { array_push ( $ parameters , $ taxonomy -> term -> slug ) ; if ( ( $ parents = $ taxonomy -> parent ( ) ) && ( $ parent = $ parents -> first ( ) ) ) return $ this -> getParentSlugs ( $ parent , $ parameters ) ; return $ parameters ; }
Get slugs of parent terms.

@param  Taxonomy  $taxonomy
@param  array     $parameters
@return array
Get slugs of parent terms .