public function getPackagesThatDependOnPackage($slug)
    {
        $plugins = $this->getInstalledPlugins();
        $themes = $this->getInstalledThemes();
        $packages = array_merge($plugins->toArray(), $themes->toArray());

        $dependent_packages = [];

        foreach ($packages as $package_name => $package) {
            if (isset($package['dependencies'])) {
                foreach ($package['dependencies'] as $dependency) {
                    if (is_array($dependency) && isset($dependency['name'])) {
                        $dependency = $dependency['name'];
                    }

                    if ($dependency === $slug) {
                        $dependent_packages[] = $package_name;
                    }
                }
            }
        }

        return $dependent_packages;
    }
public function getPackagesThatDependOnPackage($slug)
    {
        $plugins = $this->getInstalledPlugins();
        $themes = $this->getInstalledThemes();
        $packages = array_merge($plugins->toArray(), $themes->toArray());

        $dependent_packages = [];

        foreach ($packages as $package_name => $package) {
            if (isset($package['dependencies'])) {
                foreach ($package['dependencies'] as $dependency) {
                    if (is_array($dependency) && isset($dependency['name'])) {
                        $dependency = $dependency['name'];
                    }

                    if ($dependency === $slug) {
                        $dependent_packages[] = $package_name;
                    }
                }
            }
        }

        return $dependent_packages;
    }
public function getPackagesThatDependOnPackage ( $ slug ) { $ plugins = $ this -> getInstalledPlugins ( ) ; $ themes = $ this -> getInstalledThemes ( ) ; $ packages = array_merge ( $ plugins -> toArray ( ) , $ themes -> toArray ( ) ) ; $ dependent_packages = [ ] ; foreach ( $ packages as $ package_name => $ package ) { if ( isset ( $ package [ 'dependencies' ] ) ) { foreach ( $ package [ 'dependencies' ] as $ dependency ) { if ( is_array ( $ dependency ) && isset ( $ dependency [ 'name' ] ) ) { $ dependency = $ dependency [ 'name' ] ; } if ( $ dependency === $ slug ) { $ dependent_packages [ ] = $ package_name ; } } } } return $ dependent_packages ; }
Return the list of packages that have the passed one as dependency

@param string $slug The slug name of the package

@return array
Return the list of packages that have the passed one as dependency