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;
	}