Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

delete environment confirmation

ayntk-ai830c047ccfab
diff --git a/app/Livewire/Project/DeleteEnvironment.php b/app/Livewire/Project/DeleteEnvironment.php
index e01741770a..7c60c64047 100644
--- a/app/Livewire/Project/DeleteEnvironment.php
+++ b/app/Livewire/Project/DeleteEnvironment.php
@@ -3,6 +3,8 @@
namespace App\Livewire\Project;
use App\Models\Environment;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class DeleteEnvironment extends Component
@@ -21,8 +23,12 @@ class DeleteEnvironment extends Component
$this->environmentName = Environment::findOrFail($this->environment_id)->name;
}
- public function delete()
+ public function delete($password)
{
+ if (!Hash::check($password, Auth::user()->password)) {
+ $this->addError('password', 'The provided password is incorrect.');
+ return;
+ }
$this->validate([
'environment_id' => 'required|int',
]);
diff --git a/resources/views/livewire/project/delete-environment.blade.php b/resources/views/livewire/project/delete-environment.blade.php
index 956ecb92e5..d405d66c11 100644
--- a/resources/views/livewire/project/delete-environment.blade.php
+++ b/resources/views/livewire/project/delete-environment.blade.php
@@ -1,14 +1,12 @@
<x-modal-confirmation
- title="Confirm Delete Environment?"
+ title="Confirm Environment Deletion?"
buttonTitle="Delete Environment"
isErrorButton
- action="delete_environment"
+ submitAction="delete"
:actions="['This will delete the selected environment.']"
confirmationLabel="Please confirm the execution of the actions by entering the Environment Name below"
shortConfirmationLabel="Environment Name"
- submitAction="delete_environment"
buttonTitle="Delete Environment"
- confirmText="{{ $environmentName }}"
+ confirmationText="{{ $environmentName }}"
step3ButtonText="Permanently Delete Environment"
->
-</x-modal-confirmation>
+/>