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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor(redirect): replace redirect calls with redirectRoute helper for consistency
Andras Bacsaief1abe17b89d
diff --git a/app/Livewire/Destination/New/Docker.php b/app/Livewire/Destination/New/Docker.phpindex 819ac3ecde..70751fa034 100644--- a/app/Livewire/Destination/New/Docker.php+++ b/app/Livewire/Destination/New/Docker.php@@ -95,7 +95,7 @@ class Docker extends Component]);}}- $this->redirect(route('destination.show', $docker->uuid));+ redirectRoute($this, 'destination.show', [$docker->uuid]);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/GlobalSearch.php b/app/Livewire/GlobalSearch.phpindex 237076acc5..5d33486927 100644--- a/app/Livewire/GlobalSearch.php+++ b/app/Livewire/GlobalSearch.php@@ -1314,10 +1314,10 @@ class GlobalSearch extends Component'server_id' => $this->selectedServerId,];- $this->redirect(route('project.resource.create', [+ redirectRoute($this, 'project.resource.create', ['project_uuid' => $this->selectedProjectUuid,'environment_uuid' => $this->selectedEnvironmentUuid,- ] + $queryParams));+ ] + $queryParams);}}diff --git a/app/Livewire/NavbarDeleteTeam.php b/app/Livewire/NavbarDeleteTeam.phpindex 9508c2adc3..a8c9329126 100644--- a/app/Livewire/NavbarDeleteTeam.php+++ b/app/Livewire/NavbarDeleteTeam.php@@ -37,7 +37,7 @@ class NavbarDeleteTeam extends ComponentrefreshSession();- return redirect()->route('team.index');+ return redirectRoute($this, 'team.index');}public function render()diff --git a/app/Livewire/Project/Application/Rollback.php b/app/Livewire/Project/Application/Rollback.phpindex e53784db56..e8edf72fa2 100644--- a/app/Livewire/Project/Application/Rollback.php+++ b/app/Livewire/Project/Application/Rollback.php@@ -66,7 +66,7 @@ class Rollback extends Componentreturn;}- return redirect()->route('project.application.deployment.show', [+ return redirectRoute($this, 'project.application.deployment.show', ['project_uuid' => $this->parameters['project_uuid'],'application_uuid' => $this->parameters['application_uuid'],'deployment_uuid' => $deployment_uuid,diff --git a/app/Livewire/Project/DeleteEnvironment.php b/app/Livewire/Project/DeleteEnvironment.phpindex e972060815..aa6e95975e 100644--- a/app/Livewire/Project/DeleteEnvironment.php+++ b/app/Livewire/Project/DeleteEnvironment.php@@ -39,7 +39,7 @@ class DeleteEnvironment extends Componentif ($environment->isEmpty()) {$environment->delete();- return redirect()->route('project.show', parameters: ['project_uuid' => $this->parameters['project_uuid']]);+ return redirectRoute($this, 'project.show', ['project_uuid' => $this->parameters['project_uuid']]);}return $this->dispatch('error', "<strong>Environment {$environment->name}</strong> has defined resources, please delete them first.");diff --git a/app/Livewire/Project/DeleteProject.php b/app/Livewire/Project/DeleteProject.phpindex 26b35b2e73..a018046fdb 100644--- a/app/Livewire/Project/DeleteProject.php+++ b/app/Livewire/Project/DeleteProject.php@@ -35,7 +35,7 @@ class DeleteProject extends Componentif ($project->isEmpty()) {$project->delete();- return redirect()->route('project.index');+ return redirectRoute($this, 'project.index');}return $this->dispatch('error', "<strong>Project {$project->name}</strong> has resources defined, please delete them first.");diff --git a/app/Livewire/Project/EnvironmentEdit.php b/app/Livewire/Project/EnvironmentEdit.phpindex d57be2cc88..529b9d7b19 100644--- a/app/Livewire/Project/EnvironmentEdit.php+++ b/app/Livewire/Project/EnvironmentEdit.php@@ -63,7 +63,7 @@ class EnvironmentEdit extends Component{try {$this->syncData(true);- $this->redirectRoute('project.environment.edit', [+ redirectRoute($this, 'project.environment.edit', ['environment_uuid' => $this->environment->uuid,'project_uuid' => $this->project->uuid,]);diff --git a/app/Livewire/Project/New/DockerImage.php b/app/Livewire/Project/New/DockerImage.phpindex 9d04ca9a52..8aff831532 100644--- a/app/Livewire/Project/New/DockerImage.php+++ b/app/Livewire/Project/New/DockerImage.php@@ -154,7 +154,7 @@ class DockerImage extends Component'fqdn' => $fqdn,]);- return redirect()->route('project.application.configuration', [+ return redirectRoute($this, 'project.application.configuration', ['application_uuid' => $application->uuid,'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,diff --git a/app/Livewire/Project/New/EmptyProject.php b/app/Livewire/Project/New/EmptyProject.phpindex 54cfc4b4d8..0360365a9a 100644--- a/app/Livewire/Project/New/EmptyProject.php+++ b/app/Livewire/Project/New/EmptyProject.php@@ -16,6 +16,6 @@ class EmptyProject extends Component'uuid' => (string) new Cuid2,]);- return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);+ return redirectRoute($this, 'project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);}}diff --git a/app/Livewire/Project/Service/Database.php b/app/Livewire/Project/Service/Database.phpindex 1e183c6bc7..301c39deec 100644--- a/app/Livewire/Project/Service/Database.php+++ b/app/Livewire/Project/Service/Database.php@@ -100,7 +100,7 @@ class Database extends Component$this->database->delete();$this->dispatch('success', 'Database deleted.');- return redirect()->route('project.service.configuration', $this->parameters);+ return redirectRoute($this, 'project.service.configuration', $this->parameters);} catch (\Throwable $e) {return handleError($e, $this);}@@ -164,7 +164,7 @@ class Database extends Component$serviceDatabase->delete();});- return redirect()->route('project.service.configuration', $redirectParams);+ return redirectRoute($this, 'project.service.configuration', $redirectParams);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/Shared/Destination.php b/app/Livewire/Project/Shared/Destination.phpindex ffd18b35c1..7ab81b7d11 100644--- a/app/Livewire/Project/Shared/Destination.php+++ b/app/Livewire/Project/Shared/Destination.php@@ -97,7 +97,7 @@ class Destination extends Componentreturn;}- return redirect()->route('project.application.deployment.show', [+ return redirectRoute($this, 'project.application.deployment.show', ['project_uuid' => data_get($this->resource, 'environment.project.uuid'),'application_uuid' => data_get($this->resource, 'uuid'),'deployment_uuid' => $deployment_uuid,diff --git a/app/Livewire/Project/Show.php b/app/Livewire/Project/Show.phpindex 7e828d14c8..e884abb4e4 100644--- a/app/Livewire/Project/Show.php+++ b/app/Livewire/Project/Show.php@@ -48,7 +48,7 @@ class Show extends Component'uuid' => (string) new Cuid2,]);- return redirect()->route('project.resource.index', [+ return redirectRoute($this, 'project.resource.index', ['project_uuid' => $this->project->uuid,'environment_uuid' => $environment->uuid,]);@@ -59,7 +59,7 @@ class Show extends Componentpublic function navigateToEnvironment($projectUuid, $environmentUuid){- return redirect()->route('project.resource.index', [+ return redirectRoute($this, 'project.resource.index', ['project_uuid' => $projectUuid,'environment_uuid' => $environmentUuid,]);diff --git a/app/Livewire/Security/PrivateKey/Create.php b/app/Livewire/Security/PrivateKey/Create.phpindex 656e73958d..8b7ba73dd9 100644--- a/app/Livewire/Security/PrivateKey/Create.php+++ b/app/Livewire/Security/PrivateKey/Create.php@@ -114,7 +114,7 @@ class Create extends Componentprivate function redirectAfterCreation(PrivateKey $privateKey){return $this->from === 'server'- ? redirect()->route('dashboard')- : redirect()->route('security.private-key.show', ['private_key_uuid' => $privateKey->uuid]);+ ? redirectRoute($this, 'dashboard')+ : redirectRoute($this, 'security.private-key.show', ['private_key_uuid' => $privateKey->uuid]);}}diff --git a/app/Livewire/Security/PrivateKey/Show.php b/app/Livewire/Security/PrivateKey/Show.phpindex c292d14a32..6be1906891 100644--- a/app/Livewire/Security/PrivateKey/Show.php+++ b/app/Livewire/Security/PrivateKey/Show.php@@ -107,7 +107,7 @@ class Show extends Component$this->private_key->safeDelete();currentTeam()->privateKeys = PrivateKey::where('team_id', currentTeam()->id)->get();- return redirect()->route('security.private-key.index');+ return redirectRoute($this, 'security.private-key.index');} catch (\Exception $e) {$this->dispatch('error', $e->getMessage());} catch (\Throwable $e) {diff --git a/app/Livewire/Server/Delete.php b/app/Livewire/Server/Delete.phpindex 27a6e7aca9..e7b64b8053 100644--- a/app/Livewire/Server/Delete.php+++ b/app/Livewire/Server/Delete.php@@ -46,7 +46,7 @@ class Delete extends Component$this->server->team_id);- return redirect()->route('server.index');+ return redirectRoute($this, 'server.index');} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Server/New/ByHetzner.php b/app/Livewire/Server/New/ByHetzner.phpindex f7d12dbc1f..f1ffa60f2c 100644--- a/app/Livewire/Server/New/ByHetzner.php+++ b/app/Livewire/Server/New/ByHetzner.php@@ -567,10 +567,10 @@ class ByHetzner extends Component]);refreshSession();- return $this->redirect(route('server.show', $server->uuid));+ return redirectRoute($this, 'server.show', [$server->uuid]);}- return redirect()->route('server.show', $server->uuid);+ return redirectRoute($this, 'server.show', [$server->uuid]);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Server/New/ByIp.php b/app/Livewire/Server/New/ByIp.phpindex 35526d59e6..1f4cdf607a 100644--- a/app/Livewire/Server/New/ByIp.php+++ b/app/Livewire/Server/New/ByIp.php@@ -128,7 +128,7 @@ class ByIp extends Component$server->settings->is_build_server = $this->is_build_server;$server->settings->save();- return redirect()->route('server.show', $server->uuid);+ return redirectRoute($this, 'server.show', [$server->uuid]);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Source/Github/Create.php b/app/Livewire/Source/Github/Create.phpindex 2f1482c89c..4ece6a92f9 100644--- a/app/Livewire/Source/Github/Create.php+++ b/app/Livewire/Source/Github/Create.php@@ -58,7 +58,7 @@ class Create extends Componentsession(['from' => session('from') + ['source_id' => $github_app->id]]);}- return redirect()->route('source.github.show', ['github_app_uuid' => $github_app->uuid]);+ return redirectRoute($this, 'source.github.show', ['github_app_uuid' => $github_app->uuid]);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Storage/Create.php b/app/Livewire/Storage/Create.phpindex 9efeb948c0..eda20342b2 100644--- a/app/Livewire/Storage/Create.php+++ b/app/Livewire/Storage/Create.php@@ -116,7 +116,7 @@ class Create extends Component$this->storage->testConnection();$this->storage->save();- return redirect()->route('storage.show', $this->storage->uuid);+ return redirectRoute($this, 'storage.show', [$this->storage->uuid]);} catch (\Throwable $e) {$this->dispatch('error', 'Failed to create storage.', $e->getMessage());// return handleError($e, $this);diff --git a/app/Livewire/Team/Create.php b/app/Livewire/Team/Create.phpindex cd15be67d7..0bcfb5631f 100644--- a/app/Livewire/Team/Create.php+++ b/app/Livewire/Team/Create.php@@ -37,7 +37,7 @@ class Create extends Componentauth()->user()->teams()->attach($team, ['role' => 'admin']);refreshSession($team);- return redirect()->route('team.index');+ return redirectRoute($this, 'team.index');} catch (\Throwable $e) {return handleError($e, $this);}