/** * Handle the event. * * @param Event $event */ public function handle(Event $event) { // Make sure it's an nginx site if (settingEnabled('nginx') && $event->site->homesteadFlag == 0) { $this->createConfig($event->site); $this->reloadNginx($event->site); } }
public function handle($id) { $group = $this->group->find($id); if (settingEnabled('homestead') == 1) { $this->updateHomesteadConfig($group); $this->envoy->run('vagrant --cmd="provision" --path="' . setting('homestead') . '"'); } $group->delete(); return [true, null]; }
public function handle(array $request) { $group = $this->group->find($request['group_id']); $sitePath = Str::camel($request['name']); if (settingEnabled('nginx') == 1) { $site = $this->createNginxSite($request, $group, $sitePath); } elseif (settingEnabled('homestead') == 1) { $site = $this->createHomesteadSite($request, $group, $sitePath); } event(new SiteWasInstalled($site, $request)); }
/** * Handle the event. * * @param Event $event */ public function handle(Event $event) { try { // Make sure it's an nginx site if (settingEnabled('homestead') && $event->site->homesteadFlag == 1) { $this->createConfig($event->site); $this->addEnv($event->site); $this->provisionVagrant($event->site); $this->addHost($event->site); } } catch (\Exception $exception) { $event->site->updateStatus($exception->getMessage()); } }
public function handle($id, $request) { // Make sure ports don't overlap. if (!$this->verifyPorts($id, $request)) { return [false, 'Starting port is used by another group!']; } $originalGroup = $this->group->find($id); $newGroup = $this->updateGroup($id, $request); if (settingEnabled('homestead') == 1) { $this->updateHomesteadConfig($originalGroup, $newGroup); $this->envoy->run('vagrant --cmd="provision" --path="' . setting('homestead') . '"'); } return [true, null]; }
public function handle($request) { // Make sure ports don't overlap. if (!$this->verifyPorts($request)) { return [false, 'Starting port is used by another group!']; } // Create the group. $group = $this->group->create($request); if (settingEnabled('homestead') == 1) { // Add the folder to the homestead dir $this->updateHomesteadConfig($group); $this->envoy->run('vagrant --cmd="provision" --path="' . setting('homestead') . '"'); } return [true, null]; }