/** * Called after the user has finished registering new services. * @return void */ public function afterRegistration() { $register = $this->command->confirm('Would you like to register system hooks?', true); if ($register) { $hookRegister = new HookRegister($this->gitlabManager); $hookRegister->registerSystemHooksOnInstances(); } }
/** * Gets or create a project from the data given. * * @param string $projectId Id of the project on GitLab. * @param string $namespaceAndName The namespace and name of the project. * @param integer $hostId The hostId to associate to. * * @return array */ protected function getProject($projectId, $namespaceAndName, $hostId) { $projectName = explode('/', $namespaceAndName); $namespace = trim($projectName[0]); $name = trim($projectName[1]); $project = (new Project())->firstOrCreate(['project_id' => $projectId, 'name' => $name, 'group' => $namespace, 'host_id' => $hostId]); $register = new HookRegister(); $register->registerWithProjectId($projectId, $hostId); return $project; }