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(environment): clear computed property cache after adding environment variables

Andras Bacsaieb1f16b62eb4
diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/All.php b/app/Livewire/Project/Shared/EnvironmentVariable/All.php
index 639c025c7f..07938d9d08 100644
--- a/app/Livewire/Project/Shared/EnvironmentVariable/All.php
+++ b/app/Livewire/Project/Shared/EnvironmentVariable/All.php
@@ -212,6 +212,12 @@ class All extends Component
$environment = $this->createEnvironmentVariable($data);
$environment->order = $maxOrder + 1;
$environment->save();
+
+ // Clear computed property cache to force refresh
+ unset($this->environmentVariables);
+ unset($this->environmentVariablesPreview);
+
+ $this->dispatch('success', 'Environment variable added.');
}
private function createEnvironmentVariable($data)
@@ -300,6 +306,9 @@ class All extends Component
public function refreshEnvs()
{
$this->resource->refresh();
+ // Clear computed property cache to force refresh
+ unset($this->environmentVariables);
+ unset($this->environmentVariablesPreview);
$this->getDevView();
}
}