From ebb2f0cc7d780a0fc124340dcbb4b7f6902dc8a6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 18 Nov 2025 10:07:08 +0100 Subject: [PATCH] refactor: simplify environment variable deletion logic in booted method --- app/Models/Application.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Models/Application.php b/app/Models/Application.php index 306c9bd7a..c2ba6e773 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -188,13 +188,16 @@ protected static function booted() // 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(); }