/** * Updates the homestead.yaml file to include the new folder. * * @param $group */ protected function updateHomesteadConfig($group) { $config = $this->yaml->parse($this->filesystem->get(setting('userDir') . '/.homestead/Homestead.yaml')); // Add the group to the folder config $config['folders'][] = ['map' => $group->starting_path, 'to' => vagrantDirectory($group->starting_path)]; app(Homestead::class)->saveHomesteadConfig($config); }
/** * Update a site in the config. * * @param $originalSite * @param $newSite * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function updateConfig($originalSite, $newSite) { $config = $this->getConfig(); // Check the sites and databases to see if we need to change anything. foreach ($config['sites'] as $key => $homesteadSite) { if ($homesteadSite['map'] == $originalSite->name) { $config['sites'][$key] = ['map' => $newSite->name, 'to' => vagrantDirectory($newSite->path)]; } } $this->saveConfig($config); }
/** * Updates the homestead.yaml file to include the new folder. * * @param $group * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ protected function updateHomesteadConfig($group) { $config = $this->yaml->parse($this->filesystem->get(setting('userDir') . '/.homestead/Homestead.yaml')); // Check the folders to see if we need to change anything. foreach ($config['folders'] as $key => $homesteadGroup) { if ($homesteadGroup['map'] == $group->starting_path) { unset($config['folders'][$key]); } } foreach ($config['sites'] as $key => $homesteadSite) { $originalPath = vagrantDirectory($group->starting_path); if (strpos($homesteadSite['to'], $originalPath) !== false) { unset($config['sites'][$key]); } } app(Homestead::class)->saveHomesteadConfig($config); }