'required|min:6', 'application.fqdn' => 'nullable', 'application.git_repository' => 'required', 'application.git_branch' => 'required', 'application.git_commit_sha' => 'nullable', 'application.install_command' => 'nullable', 'application.build_command' => 'nullable', 'application.start_command' => 'nullable', 'application.build_pack' => 'required', 'application.static_image' => 'required', 'application.base_directory' => 'required', 'application.publish_directory' => 'nullable', 'application.ports_exposes' => 'required', 'application.ports_mappings' => 'nullable', ]; public function instantSave() { // @TODO: find another way $this->application->settings->is_static = $this->is_static; $this->application->settings->is_git_submodules_allowed = $this->is_git_submodules_allowed; $this->application->settings->is_git_lfs_allowed = $this->is_git_lfs_allowed; $this->application->settings->is_debug = $this->is_debug; $this->application->settings->is_previews = $this->is_previews; $this->application->settings->is_custom_ssl = $this->is_custom_ssl; $this->application->settings->is_http2 = $this->is_http2; $this->application->settings->is_auto_deploy = $this->is_auto_deploy; $this->application->settings->is_dual_cert = $this->is_dual_cert; $this->application->settings->save(); $this->application->refresh(); } public function mount() { $this->application = Application::where('id', $this->applicationId)->with('destination', 'settings')->firstOrFail(); $this->is_static = $this->application->settings->is_static; $this->is_git_submodules_allowed = $this->application->settings->is_git_submodules_allowed; $this->is_git_lfs_allowed = $this->application->settings->is_git_lfs_allowed; $this->is_debug = $this->application->settings->is_debug; $this->is_previews = $this->application->settings->is_previews; $this->is_custom_ssl = $this->application->settings->is_custom_ssl; $this->is_http2 = $this->application->settings->is_http2; $this->is_auto_deploy = $this->application->settings->is_auto_deploy; $this->is_dual_cert = $this->application->settings->is_dual_cert; } public function submit() { $this->validate(); $this->application->save(); } }