diff --git a/app/Livewire/Project/EnvironmentEdit.php b/app/Livewire/Project/EnvironmentEdit.php new file mode 100644 index 000000000..a87e2092b --- /dev/null +++ b/app/Livewire/Project/EnvironmentEdit.php @@ -0,0 +1,41 @@ + 'required|min:3|max:255', + 'environment.description' => 'nullable|min:3|max:255', + ]; + public function mount() { + $this->parameters = get_route_parameters(); + + $this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->first(); + $this->environment = $this->project->environments()->where('name', request()->route('environment_name'))->first(); + } + + public function submit() + { + $this->validate(); + try { + $this->environment->save(); + return redirect()->route('project.environment.edit', ['project_uuid' => $this->project->uuid, 'environment_name' => $this->environment->name]); + } catch (\Throwable $e) { + return handleError($e, $this); + } + } + public function render() + { + return view('livewire.project.environment-edit'); + } +} diff --git a/database/migrations/2023_12_30_134507_add_description_to_environments.php b/database/migrations/2023_12_30_134507_add_description_to_environments.php new file mode 100644 index 000000000..0e8f4fec3 --- /dev/null +++ b/database/migrations/2023_12_30_134507_add_description_to_environments.php @@ -0,0 +1,28 @@ +string('description')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('environments', function (Blueprint $table) { + $table->dropColumn('description'); + }); + } +}; diff --git a/resources/views/livewire/project/environment-edit.blade.php b/resources/views/livewire/project/environment-edit.blade.php new file mode 100644 index 000000000..f88bbdb05 --- /dev/null +++ b/resources/views/livewire/project/environment-edit.blade.php @@ -0,0 +1,44 @@ +
No environments found.
@endforelse +