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 project confirmation

ayntk-aib656cabb33fc
diff --git a/app/Livewire/Project/DeleteProject.php b/app/Livewire/Project/DeleteProject.php
index 360fad10a8..75060f8f3a 100644
--- a/app/Livewire/Project/DeleteProject.php
+++ b/app/Livewire/Project/DeleteProject.php
@@ -3,6 +3,8 @@
namespace App\Livewire\Project;
use App\Models\Project;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class DeleteProject extends Component
@@ -21,8 +23,12 @@ class DeleteProject extends Component
$this->projectName = Project::findOrFail($this->project_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([
'project_id' => 'required|int',
]);
diff --git a/resources/views/livewire/project/delete-project.blade.php b/resources/views/livewire/project/delete-project.blade.php
index b8e996f56d..990caaf920 100644
--- a/resources/views/livewire/project/delete-project.blade.php
+++ b/resources/views/livewire/project/delete-project.blade.php
@@ -2,12 +2,11 @@
title="Confirm Project Deletion?"
buttonTitle="Delete Project"
isErrorButton
- action="delete_project"
+ submitAction="delete"
:actions="['This will delete the selected project.']"
confirmationLabel="Please confirm the execution of the actions by entering the Project Name below"
shortConfirmationLabel="Project Name"
- submitAction="delete_project"
buttonTitle="Delete Project"
- confirmText="{{ $projectName }}"
+ confirmationText="{{ $projectName }}"
step3ButtonText="Permanently Delete Project"
/>