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.

refactor: simplify environment variable deletion logic in booted method

Andras Bacsai5ba3c6879c60
diff --git a/app/Models/Application.php b/app/Models/Application.php
index 306c9bd7a2..c2ba6e7735 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -188,13 +188,16 @@ class Application extends BaseModel
// Remove SERVICE_FQDN_* and SERVICE_URL_* environment variables
$application->environment_variables()
- ->where('key', 'LIKE', 'SERVICE_FQDN_%')
- ->orWhere('key', 'LIKE', 'SERVICE_URL_%')
+ ->where(function ($q) {
+ $q->where('key', 'LIKE', 'SERVICE_FQDN_%')
+ ->orWhere('key', 'LIKE', 'SERVICE_URL_%');
+ })
->delete();
-
$application->environment_variables_preview()
- ->where('key', 'LIKE', 'SERVICE_FQDN_%')
- ->orWhere('key', 'LIKE', 'SERVICE_URL_%')
+ ->where(function ($q) {
+ $q->where('key', 'LIKE', 'SERVICE_FQDN_%')
+ ->orWhere('key', 'LIKE', 'SERVICE_URL_%');
+ })
->delete();
}