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.

fix: in dev mode do not ask confirmation on delete

Andras Bacsaibcc92e1f32ab
diff --git a/app/Livewire/Project/Shared/Danger.php b/app/Livewire/Project/Shared/Danger.php
index 543e645393..c052608995 100644
--- a/app/Livewire/Project/Shared/Danger.php
+++ b/app/Livewire/Project/Shared/Danger.php
@@ -91,10 +91,12 @@ class Danger extends Component
public function delete($password)
{
- if (! Hash::check($password, Auth::user()->password)) {
- $this->addError('password', 'The provided password is incorrect.');
+ if (isProduction()) {
+ if (! Hash::check($password, Auth::user()->password)) {
+ $this->addError('password', 'The provided password is incorrect.');
- return;
+ return;
+ }
}
if (! $this->resource) {
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index d226bc1f41..60e50d50c2 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -343,6 +343,11 @@ function isSubscribed()
{
return isSubscriptionActive() || auth()->user()->isInstanceAdmin();
}
+
+function isProduction(): bool
+{
+ return ! isDev();
+}
function isDev(): bool
{
return config('app.env') === 'local';
diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php
index dcb760ef94..06d436b157 100644
--- a/resources/views/components/modal-confirmation.blade.php
+++ b/resources/views/components/modal-confirmation.blade.php
@@ -296,9 +296,16 @@
</template>
<template x-if="step === 1">
- <x-forms.button @click="step++" class="w-auto" isError>
- <span x-text="step1ButtonText"></span>
- </x-forms.button>
+ @if(isDev())
+ <x-forms.button class="w-auto" isError
+ @click="$wire.delete('hello')">
+ <span x-text="step3ButtonText"></span>
+ </x-forms.button>
+ @else
+ <x-forms.button @click="step++" class="w-auto" isError>
+ <span x-text="step1ButtonText"></span>
+ </x-forms.button>
+ @endif
</template>
<template x-if="step === 2">