[ 'required', Rule::in($this->site->server->installedPHPVersions()), ], 'source_control' => [ 'required', Rule::exists('source_controls', 'id'), ], 'web_directory' => [ 'nullable', ], 'repository' => [ 'required', ], 'branch' => [ 'required', ], 'composer' => [ 'nullable', ], ]; } public function createFields(array $input): array { return [ 'web_directory' => $input['web_directory'] ?? '', 'source_control_id' => $input['source_control'] ?? '', 'repository' => $input['repository'] ?? '', 'branch' => $input['branch'] ?? '', 'php_version' => $input['php_version'] ?? '', 'composer' => $input['php_version'] ?? '', ]; } public function data(array $input): array { return [ 'composer' => isset($input['composer']) && $input['composer'], ]; } /** * @throws FailedToDeployGitKey * @throws SSHError */ public function install(): void { $this->isolate(); /** @var Webserver $webserver */ $webserver = $this->site->server->webserver()->handler(); $webserver->createVHost($this->site); $this->progress(15); $this->deployKey(); $this->progress(30); app(Git::class)->clone($this->site); $this->progress(65); $this->site->php()?->restart(); if ($this->site->type_data['composer']) { app(Composer::class)->installDependencies($this->site); } } public function editRules(array $input): array { return []; } public function edit(): void { // } }