protected static function familyTree(Collection $categories) : array
	{
		$ids = isset($ids) && count($ids) > 0 ? $ids : [];

        foreach ($categories as $category) {
            $ids[] = $category->id;
            if ($category->childrenRecursive->count() > 0) {
                $ids[] = static::familyTree($category->childrenRecursive);
            }
        }

        return $ids;
	}
protected static function familyTree(Collection $categories) : array
	{
		$ids = isset($ids) && count($ids) > 0 ? $ids : [];

        foreach ($categories as $category) {
            $ids[] = $category->id;
            if ($category->childrenRecursive->count() > 0) {
                $ids[] = static::familyTree($category->childrenRecursive);
            }
        }

        return $ids;
	}
protected static function familyTree ( Collection $ categories ) : array { $ ids = isset ( $ ids ) && count ( $ ids ) > 0 ? $ ids : [ ] ; foreach ( $ categories as $ category ) { $ ids [ ] = $ category -> id ; if ( $ category -> childrenRecursive -> count ( ) > 0 ) { $ ids [ ] = static :: familyTree ( $ category -> childrenRecursive ) ; } } return $ ids ; }
Returns the family tree ids for the given categories.

@param  Collection $categories
@return array
Returns the family tree ids for the given categories .