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(project): update redirect logic after resource creation to include environment UUID

Andras Bacsaia39bd8c5b064
diff --git a/app/Livewire/Project/AddEmpty.php b/app/Livewire/Project/AddEmpty.php
index 751b4945b7..974f0608a6 100644
--- a/app/Livewire/Project/AddEmpty.php
+++ b/app/Livewire/Project/AddEmpty.php
@@ -37,7 +37,12 @@ class AddEmpty extends Component
'uuid' => (string) new Cuid2,
]);
- return redirect()->route('project.show', $project->uuid);
+ $productionEnvironment = $project->environments()->where('name', 'production')->first();
+
+ return redirect()->route('project.resource.index', [
+ 'project_uuid' => $project->uuid,
+ 'environment_uuid' => $productionEnvironment->uuid,
+ ]);
} catch (\Throwable $e) {
return handleError($e, $this);
}