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
new uuid routes
peaklabs-dev277fd78769cf
diff --git a/app/Livewire/Project/AddEmpty.php b/app/Livewire/Project/AddEmpty.phpindex fd976548ab..07873c059d 100644--- a/app/Livewire/Project/AddEmpty.php+++ b/app/Livewire/Project/AddEmpty.php@@ -5,6 +5,7 @@ namespace App\Livewire\Project;use App\Models\Project;use Livewire\Attributes\Validate;use Livewire\Component;+use Visus\Cuid2\Cuid2;class AddEmpty extends Component{@@ -22,6 +23,7 @@ class AddEmpty extends Component'name' => $this->name,'description' => $this->description,'team_id' => currentTeam()->id,+ 'uuid' => (string) new Cuid2,]);return redirect()->route('project.show', $project->uuid);diff --git a/app/Livewire/Project/Application/Configuration.php b/app/Livewire/Project/Application/Configuration.phpindex d4ec8f581c..2b781a8c72 100644--- a/app/Livewire/Project/Application/Configuration.php+++ b/app/Livewire/Project/Application/Configuration.php@@ -20,7 +20,7 @@ class Configuration extends Componentif (! $project) {return redirect()->route('dashboard');}- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);if (! $environment) {return redirect()->route('dashboard');}diff --git a/app/Livewire/Project/Application/Deployment/Index.php b/app/Livewire/Project/Application/Deployment/Index.phpindex 4f761c2cf6..b847c40ef1 100644--- a/app/Livewire/Project/Application/Deployment/Index.php+++ b/app/Livewire/Project/Application/Deployment/Index.php@@ -34,7 +34,7 @@ class Index extends Componentif (! $project) {return redirect()->route('dashboard');}- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);if (! $environment) {return redirect()->route('dashboard');}diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.phpindex d42bf03d78..bdf62706c3 100644--- a/app/Livewire/Project/Application/Previews.php+++ b/app/Livewire/Project/Application/Previews.php@@ -171,7 +171,7 @@ class Previews extends Component'project_uuid' => $this->parameters['project_uuid'],'application_uuid' => $this->parameters['application_uuid'],'deployment_uuid' => $this->deployment_uuid,- 'environment_name' => $this->parameters['environment_name'],+ 'environment_uuid' => $this->parameters['environment_uuid'],]);} catch (\Throwable $e) {return handleError($e, $this);diff --git a/app/Livewire/Project/Application/Rollback.php b/app/Livewire/Project/Application/Rollback.phpindex 1e58a14586..ff5db1e08c 100644--- a/app/Livewire/Project/Application/Rollback.php+++ b/app/Livewire/Project/Application/Rollback.php@@ -37,7 +37,7 @@ class Rollback extends Component'project_uuid' => $this->parameters['project_uuid'],'application_uuid' => $this->parameters['application_uuid'],'deployment_uuid' => $deployment_uuid,- 'environment_name' => $this->parameters['environment_name'],+ 'environment_uuid' => $this->parameters['environment_uuid'],]);}diff --git a/app/Livewire/Project/CloneMe.php b/app/Livewire/Project/CloneMe.phpindex 4d2bc65891..e2013a50d3 100644--- a/app/Livewire/Project/CloneMe.php+++ b/app/Livewire/Project/CloneMe.php@@ -12,7 +12,7 @@ class CloneMe extends Component{public string $project_uuid;- public string $environment_name;+ public string $environment_uuid;public int $project_id;@@ -44,7 +44,7 @@ class CloneMe extends Component{$this->project_uuid = $project_uuid;$this->project = Project::where('uuid', $project_uuid)->firstOrFail();- $this->environment = $this->project->environments->where('name', $this->environment_name)->first();+ $this->environment = $this->project->environments->where('uuid', $this->environment_uuid)->first();$this->project_id = $this->project->id;$this->servers = currentTeam()->servers;$this->newName = str($this->project->name.'-clone-'.(string) new Cuid2)->slug();@@ -89,6 +89,7 @@ class CloneMe extends Componentif ($this->environment->name !== 'production') {$project->environments()->create(['name' => $this->environment->name,+ 'uuid' => (string) new Cuid2,]);}$environment = $project->environments->where('name', $this->environment->name)->first();@@ -100,6 +101,7 @@ class CloneMe extends Component$project = $this->project;$environment = $this->project->environments()->create(['name' => $this->newName,+ 'uuid' => (string) new Cuid2,]);}$applications = $this->environment->applications;@@ -183,7 +185,7 @@ class CloneMe extends Componentreturn redirect()->route('project.resource.index', ['project_uuid' => $project->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,]);} catch (\Exception $e) {return handleError($e, $this);diff --git a/app/Livewire/Project/Database/Backup/Execution.php b/app/Livewire/Project/Database/Backup/Execution.phpindex 5640916595..4ac3b2e2c5 100644--- a/app/Livewire/Project/Database/Backup/Execution.php+++ b/app/Livewire/Project/Database/Backup/Execution.php@@ -22,7 +22,7 @@ class Execution extends Componentif (! $project) {return redirect()->route('dashboard');}- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);if (! $environment) {return redirect()->route('dashboard');}diff --git a/app/Livewire/Project/Database/Backup/Index.php b/app/Livewire/Project/Database/Backup/Index.phpindex 9ff2f48d5f..2df32ec7bf 100644--- a/app/Livewire/Project/Database/Backup/Index.php+++ b/app/Livewire/Project/Database/Backup/Index.php@@ -14,7 +14,7 @@ class Index extends Componentif (! $project) {return redirect()->route('dashboard');}- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);if (! $environment) {return redirect()->route('dashboard');}@@ -31,7 +31,7 @@ class Index extends Component) {return redirect()->route('project.database.configuration', ['project_uuid' => $project->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'database_uuid' => $database->uuid,]);}diff --git a/app/Livewire/Project/Database/Configuration.php b/app/Livewire/Project/Database/Configuration.phpindex e14b27cf61..bbe8e81f6b 100644--- a/app/Livewire/Project/Database/Configuration.php+++ b/app/Livewire/Project/Database/Configuration.php@@ -14,7 +14,7 @@ class Configuration extends Componentif (! $project) {return redirect()->route('dashboard');}- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first()->load(['applications']);+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first()->load(['applications']);if (! $environment) {return redirect()->route('dashboard');}diff --git a/app/Livewire/Project/EnvironmentEdit.php b/app/Livewire/Project/EnvironmentEdit.phpindex f48220b3dd..e98b088ecf 100644--- a/app/Livewire/Project/EnvironmentEdit.php+++ b/app/Livewire/Project/EnvironmentEdit.php@@ -23,11 +23,11 @@ class EnvironmentEdit extends Component#[Validate(['nullable', 'string', 'max:255'])]public ?string $description = null;- public function mount(string $project_uuid, string $environment_name)+ public function mount(string $project_uuid, string $environment_uuid){try {$this->project = Project::ownedByCurrentTeam()->where('uuid', $project_uuid)->firstOrFail();- $this->environment = $this->project->environments()->where('name', $environment_name)->firstOrFail();+ $this->environment = $this->project->environments()->where('uuid', $environment_uuid)->firstOrFail();$this->syncData();} catch (\Throwable $e) {return handleError($e, $this);@@ -52,7 +52,10 @@ class EnvironmentEdit extends Component{try {$this->syncData(true);- $this->redirectRoute('project.environment.edit', ['environment_name' => $this->environment->name, 'project_uuid' => $this->project->uuid]);+ $this->redirectRoute('project.environment.edit', [+ 'environment_uuid' => $this->environment->uuid,+ 'project_uuid' => $this->project->uuid,+ ]);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/New/DockerCompose.php b/app/Livewire/Project/New/DockerCompose.phpindex 199a20cf6e..c1361c7acd 100644--- a/app/Livewire/Project/New/DockerCompose.php+++ b/app/Livewire/Project/New/DockerCompose.php@@ -59,7 +59,7 @@ class DockerCompose extends Component}$project = Project::where('uuid', $this->parameters['project_uuid'])->first();- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();$destination_uuid = $this->query['destination'];$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();@@ -96,7 +96,7 @@ class DockerCompose extends Componentreturn redirect()->route('project.service.configuration', ['service_uuid' => $service->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);} catch (\Throwable $e) {diff --git a/app/Livewire/Project/New/DockerImage.php b/app/Livewire/Project/New/DockerImage.phpindex 417fb2ea02..9429244377 100644--- a/app/Livewire/Project/New/DockerImage.php+++ b/app/Livewire/Project/New/DockerImage.php@@ -45,7 +45,7 @@ class DockerImage extends Component$destination_class = $destination->getMorphClass();$project = Project::where('uuid', $this->parameters['project_uuid'])->first();- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();$application = Application::create(['name' => 'docker-image-'.new Cuid2,'repository_project_id' => 0,@@ -69,7 +69,7 @@ class DockerImage extends Componentreturn redirect()->route('project.application.configuration', ['application_uuid' => $application->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);}diff --git a/app/Livewire/Project/New/EmptyProject.php b/app/Livewire/Project/New/EmptyProject.phpindex 28249b442a..54cfc4b4d8 100644--- a/app/Livewire/Project/New/EmptyProject.php+++ b/app/Livewire/Project/New/EmptyProject.php@@ -4,6 +4,7 @@ namespace App\Livewire\Project\New;use App\Models\Project;use Livewire\Component;+use Visus\Cuid2\Cuid2;class EmptyProject extends Component{@@ -12,8 +13,9 @@ class EmptyProject extends Component$project = Project::create(['name' => generate_random_name(),'team_id' => currentTeam()->id,+ 'uuid' => (string) new Cuid2,]);- return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_name' => 'production']);+ return redirect()->route('project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);}}diff --git a/app/Livewire/Project/New/GithubPrivateRepository.php b/app/Livewire/Project/New/GithubPrivateRepository.phpindex 2f4f5a25c5..370d005557 100644--- a/app/Livewire/Project/New/GithubPrivateRepository.php+++ b/app/Livewire/Project/New/GithubPrivateRepository.php@@ -177,7 +177,7 @@ class GithubPrivateRepository extends Component$destination_class = $destination->getMorphClass();$project = Project::where('uuid', $this->parameters['project_uuid'])->first();- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();$application = Application::create(['name' => generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name),@@ -211,7 +211,7 @@ class GithubPrivateRepository extends Componentreturn redirect()->route('project.application.configuration', ['application_uuid' => $application->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);} catch (\Throwable $e) {diff --git a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.phpindex b46c4a7943..01b0c9ae85 100644--- a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php+++ b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php@@ -136,7 +136,7 @@ class GithubPrivateRepositoryDeployKey extends Component$this->get_git_source();$project = Project::where('uuid', $this->parameters['project_uuid'])->first();- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();if ($this->git_source === 'other') {$application_init = ['name' => generate_random_name(),@@ -184,7 +184,7 @@ class GithubPrivateRepositoryDeployKey extends Componentreturn redirect()->route('project.application.configuration', ['application_uuid' => $application->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);} catch (\Throwable $e) {diff --git a/app/Livewire/Project/New/PublicGitRepository.php b/app/Livewire/Project/New/PublicGitRepository.phpindex bd35dccef6..2f2331fc00 100644--- a/app/Livewire/Project/New/PublicGitRepository.php+++ b/app/Livewire/Project/New/PublicGitRepository.php@@ -225,7 +225,7 @@ class PublicGitRepository extends Component$this->validate();$destination_uuid = $this->query['destination'];$project_uuid = $this->parameters['project_uuid'];- $environment_name = $this->parameters['environment_name'];+ $environment_uuid = $this->parameters['environment_uuid'];$destination = StandaloneDocker::where('uuid', $destination_uuid)->first();if (! $destination) {@@ -237,7 +237,7 @@ class PublicGitRepository extends Component$destination_class = $destination->getMorphClass();$project = Project::where('uuid', $project_uuid)->first();- $environment = $project->load(['environments'])->environments->where('name', $environment_name)->first();+ $environment = $project->load(['environments'])->environments->where('uuid', $environment_uuid)->first();if ($this->build_pack === 'dockercompose' && isDev() && $this->new_compose_services) {$server = $destination->server;@@ -260,7 +260,7 @@ class PublicGitRepository extends Componentreturn redirect()->route('project.service.configuration', ['service_uuid' => $service->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);@@ -319,7 +319,7 @@ class PublicGitRepository extends Componentreturn redirect()->route('project.application.configuration', ['application_uuid' => $application->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);} catch (\Throwable $e) {diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.phpindex 3dedc11af7..7ef6887186 100644--- a/app/Livewire/Project/New/Select.php+++ b/app/Livewire/Project/New/Select.php@@ -61,7 +61,7 @@ class Select extends Component}$projectUuid = data_get($this->parameters, 'project_uuid');$this->environments = Project::whereUuid($projectUuid)->first()->environments;- $this->selectedEnvironment = data_get($this->parameters, 'environment_name');+ $this->selectedEnvironment = data_get($this->parameters, 'environment_uuid');}public function render()@@ -73,20 +73,10 @@ class Select extends Component{return redirect()->route('project.resource.create', ['project_uuid' => $this->parameters['project_uuid'],- 'environment_name' => $this->selectedEnvironment,+ 'environment_uuid' => $this->selectedEnvironment,]);}- // public function addExistingPostgresql()- // {- // try {- // instantCommand("psql {$this->existingPostgresqlUrl} -c 'SELECT 1'");- // $this->dispatch('success', 'Successfully connected to the database.');- // } catch (\Throwable $e) {- // return handleError($e, $this);- // }- // }-public function loadServices(){$services = get_service_templates(true);@@ -304,7 +294,7 @@ class Select extends Componentreturn redirect()->route('project.resource.create', ['project_uuid' => $this->parameters['project_uuid'],- 'environment_name' => $this->parameters['environment_name'],+ 'environment_uuid' => $this->parameters['environment_uuid'],'type' => $this->type,'destination' => $this->destination_uuid,'server_id' => $this->server_id,@@ -319,7 +309,7 @@ class Select extends Component} else {return redirect()->route('project.resource.create', ['project_uuid' => $this->parameters['project_uuid'],- 'environment_name' => $this->parameters['environment_name'],+ 'environment_uuid' => $this->parameters['environment_uuid'],'type' => $this->type,'destination' => $this->destination_uuid,'server_id' => $this->server_id,diff --git a/app/Livewire/Project/New/SimpleDockerfile.php b/app/Livewire/Project/New/SimpleDockerfile.phpindex 3c7f42329e..c3ed6039a0 100644--- a/app/Livewire/Project/New/SimpleDockerfile.php+++ b/app/Livewire/Project/New/SimpleDockerfile.php@@ -46,7 +46,7 @@ CMD ["nginx", "-g", "daemon off;"]$destination_class = $destination->getMorphClass();$project = Project::where('uuid', $this->parameters['project_uuid'])->first();- $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();+ $environment = $project->load(['environments'])->environments->where('uuid', $this->parameters['environment_uuid'])->first();$port = get_port_from_dockerfile($this->dockerfile);if (! $port) {@@ -78,7 +78,7 @@ CMD ["nginx", "-g", "daemon off;"]return redirect()->route('project.application.configuration', ['application_uuid' => $application->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);}diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.phpindex 9266a57fc8..48c396dc01 100644--- a/app/Livewire/Project/Resource/Create.php+++ b/app/Livewire/Project/Resource/Create.php@@ -25,7 +25,7 @@ class Create extends Componentreturn redirect()->route('dashboard');}$this->project = $project;- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();if (! $environment) {return redirect()->route('dashboard');}@@ -57,7 +57,7 @@ class Create extends Componentreturn redirect()->route('project.database.configuration', ['project_uuid' => $project->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'database_uuid' => $database->uuid,]);}@@ -106,7 +106,7 @@ class Create extends Componentreturn redirect()->route('project.service.configuration', ['service_uuid' => $service->uuid,- 'environment_name' => $environment->name,+ 'environment_uuid' => $environment->uuid,'project_uuid' => $project->uuid,]);}diff --git a/app/Livewire/Project/Resource/Index.php b/app/Livewire/Project/Resource/Index.phpindex 2834968875..fc394e88fe 100644--- a/app/Livewire/Project/Resource/Index.php+++ b/app/Livewire/Project/Resource/Index.php@@ -41,7 +41,7 @@ class Index extends Componentif (! $project) {return redirect()->route('dashboard');}- $environment = $project->load(['environments'])->environments->where('name', request()->route('environment_name'))->first();+ $environment = $project->load(['environments'])->environments->where('uuid', request()->route('environment_uuid'))->first();if (! $environment) {return redirect()->route('dashboard');}@@ -52,7 +52,7 @@ class Index extends Componentif (data_get($application, 'environment.project.uuid')) {$application->hrefLink = route('project.application.configuration', ['project_uuid' => data_get($application, 'environment.project.uuid'),- 'environment_name' => data_get($application, 'environment.name'),+ 'environment_uuid' => data_get($application, 'environment.uuid'),'application_uuid' => data_get($application, 'uuid'),]);}@@ -64,7 +64,7 @@ class Index extends Componentif (data_get($postgresql, 'environment.project.uuid')) {$postgresql->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($postgresql, 'environment.project.uuid'),- 'environment_name' => data_get($postgresql, 'environment.name'),+ 'environment_uuid' => data_get($postgresql, 'environment.uuid'),'database_uuid' => data_get($postgresql, 'uuid'),]);}@@ -76,7 +76,7 @@ class Index extends Componentif (data_get($redis, 'environment.project.uuid')) {$redis->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($redis, 'environment.project.uuid'),- 'environment_name' => data_get($redis, 'environment.name'),+ 'environment_uuid' => data_get($redis, 'environment.uuid'),'database_uuid' => data_get($redis, 'uuid'),]);}@@ -88,7 +88,7 @@ class Index extends Componentif (data_get($mongodb, 'environment.project.uuid')) {$mongodb->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($mongodb, 'environment.project.uuid'),- 'environment_name' => data_get($mongodb, 'environment.name'),+ 'environment_uuid' => data_get($mongodb, 'environment.uuid'),'database_uuid' => data_get($mongodb, 'uuid'),]);}@@ -100,7 +100,7 @@ class Index extends Componentif (data_get($mysql, 'environment.project.uuid')) {$mysql->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($mysql, 'environment.project.uuid'),- 'environment_name' => data_get($mysql, 'environment.name'),+ 'environment_uuid' => data_get($mysql, 'environment.uuid'),'database_uuid' => data_get($mysql, 'uuid'),]);}@@ -112,7 +112,7 @@ class Index extends Componentif (data_get($mariadb, 'environment.project.uuid')) {$mariadb->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($mariadb, 'environment.project.uuid'),- 'environment_name' => data_get($mariadb, 'environment.name'),+ 'environment_uuid' => data_get($mariadb, 'environment.uuid'),'database_uuid' => data_get($mariadb, 'uuid'),]);}@@ -124,7 +124,7 @@ class Index extends Componentif (data_get($keydb, 'environment.project.uuid')) {$keydb->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($keydb, 'environment.project.uuid'),- 'environment_name' => data_get($keydb, 'environment.name'),+ 'environment_uuid' => data_get($keydb, 'environment.uuid'),'database_uuid' => data_get($keydb, 'uuid'),]);}@@ -136,7 +136,7 @@ class Index extends Componentif (data_get($dragonfly, 'environment.project.uuid')) {$dragonfly->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($dragonfly, 'environment.project.uuid'),- 'environment_name' => data_get($dragonfly, 'environment.name'),+ 'environment_uuid' => data_get($dragonfly, 'environment.uuid'),'database_uuid' => data_get($dragonfly, 'uuid'),]);}@@ -148,7 +148,7 @@ class Index extends Componentif (data_get($clickhouse, 'environment.project.uuid')) {$clickhouse->hrefLink = route('project.database.configuration', ['project_uuid' => data_get($clickhouse, 'environment.project.uuid'),- 'environment_name' => data_get($clickhouse, 'environment.name'),+ 'environment_uuid' => data_get($clickhouse, 'environment.uuid'),'database_uuid' => data_get($clickhouse, 'uuid'),]);}@@ -160,7 +160,7 @@ class Index extends Componentif (data_get($service, 'environment.project.uuid')) {$service->hrefLink = route('project.service.configuration', ['project_uuid' => data_get($service, 'environment.project.uuid'),- 'environment_name' => data_get($service, 'environment.name'),+ 'environment_uuid' => data_get($service, 'environment.uuid'),'service_uuid' => data_get($service, 'uuid'),]);$service->status = $service->status();diff --git a/app/Livewire/Project/Shared/Danger.php b/app/Livewire/Project/Shared/Danger.phpindex a0b4ac2c45..7da48f9fb4 100644--- a/app/Livewire/Project/Shared/Danger.php+++ b/app/Livewire/Project/Shared/Danger.php@@ -20,7 +20,7 @@ class Danger extends Componentpublic $projectUuid;- public $environmentName;+ public $environmentUuid;public bool $delete_configurations = true;@@ -39,7 +39,7 @@ class Danger extends Component$parameters = get_route_parameters();$this->modalId = new Cuid2;$this->projectUuid = data_get($parameters, 'project_uuid');- $this->environmentName = data_get($parameters, 'environment_name');+ $this->environmentUuid = data_get($parameters, 'environment_uuid');if ($this->resource === null) {if (isset($parameters['service_uuid'])) {@@ -107,7 +107,7 @@ class Danger extends Componentreturn redirect()->route('project.resource.index', ['project_uuid' => $this->projectUuid,- 'environment_name' => $this->environmentName,+ 'environment_uuid' => $this->environmentUuid,]);} catch (\Throwable $e) {return handleError($e, $this);diff --git a/app/Livewire/Project/Shared/Destination.php b/app/Livewire/Project/Shared/Destination.phpindex c305e817cf..e28ff1d5b0 100644--- a/app/Livewire/Project/Shared/Destination.php+++ b/app/Livewire/Project/Shared/Destination.php@@ -85,7 +85,7 @@ class Destination extends Component'project_uuid' => data_get($this->resource, 'environment.project.uuid'),'application_uuid' => data_get($this->resource, 'uuid'),'deployment_uuid' => $deployment_uuid,- 'environment_name' => data_get($this->resource, 'environment.name'),+ 'environment_uuid' => data_get($this->resource, 'environment.uuid'),]);}diff --git a/app/Livewire/Project/Shared/ResourceOperations.php b/app/Livewire/Project/Shared/ResourceOperations.phpindex e67df6aa90..81313c1337 100644--- a/app/Livewire/Project/Shared/ResourceOperations.php+++ b/app/Livewire/Project/Shared/ResourceOperations.php@@ -15,7 +15,7 @@ class ResourceOperations extends Componentpublic $projectUuid;- public $environmentName;+ public $environmentUuid;public $projects;@@ -25,7 +25,7 @@ class ResourceOperations extends Component{$parameters = get_route_parameters();$this->projectUuid = data_get($parameters, 'project_uuid');- $this->environmentName = data_get($parameters, 'environment_name');+ $this->environmentUuid = data_get($parameters, 'environment_uuid');$this->projects = Project::ownedByCurrentTeam()->get();$this->servers = currentTeam()->servers;}@@ -72,7 +72,7 @@ class ResourceOperations extends Component}$route = route('project.application.configuration', ['project_uuid' => $this->projectUuid,- 'environment_name' => $this->environmentName,+ 'environment_uuid' => $this->environmentUuid,'application_uuid' => $new_resource->uuid,]).'#resource-operations';@@ -115,7 +115,7 @@ class ResourceOperations extends Component}$route = route('project.database.configuration', ['project_uuid' => $this->projectUuid,- 'environment_name' => $this->environmentName,+ 'environment_uuid' => $this->environmentUuid,'database_uuid' => $new_resource->uuid,]).'#resource-operations';@@ -141,7 +141,7 @@ class ResourceOperations extends Component$new_resource->parse();$route = route('project.service.configuration', ['project_uuid' => $this->projectUuid,- 'environment_name' => $this->environmentName,+ 'environment_uuid' => $this->environmentUuid,'service_uuid' => $new_resource->uuid,]).'#resource-operations';@@ -159,7 +159,7 @@ class ResourceOperations extends Componentif ($this->resource->type() === 'application') {$route = route('project.application.configuration', ['project_uuid' => $new_environment->project->uuid,- 'environment_name' => $new_environment->name,+ 'environment_uuid' => $new_environment->uuid,'application_uuid' => $this->resource->uuid,]).'#resource-operations';@@ -167,7 +167,7 @@ class ResourceOperations extends Component} elseif (str($this->resource->type())->startsWith('standalone-')) {$route = route('project.database.configuration', ['project_uuid' => $new_environment->project->uuid,- 'environment_name' => $new_environment->name,+ 'environment_uuid' => $new_environment->uuid,'database_uuid' => $this->resource->uuid,]).'#resource-operations';@@ -175,7 +175,7 @@ class ResourceOperations extends Component} elseif ($this->resource->type() === 'service') {$route = route('project.service.configuration', ['project_uuid' => $new_environment->project->uuid,- 'environment_name' => $new_environment->name,+ 'environment_uuid' => $new_environment->uuid,'service_uuid' => $this->resource->uuid,]).'#resource-operations';diff --git a/app/Livewire/SharedVariables/Environment/Show.php b/app/Livewire/SharedVariables/Environment/Show.phpindex daf1df212e..68aa4f01bf 100644--- a/app/Livewire/SharedVariables/Environment/Show.php+++ b/app/Livewire/SharedVariables/Environment/Show.php@@ -42,8 +42,8 @@ class Show extends Componentpublic function mount(){$this->parameters = get_route_parameters();- $this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->first();- $this->environment = $this->project->environments()->where('name', request()->route('environment_name'))->first();+ $this->project = Project::ownedByCurrentTeam()->where('uuid', request()->route('project_uuid'))->firstOrFail();+ $this->environment = $this->project->environments()->where('uuid', request()->route('environment_uuid'))->firstOrFail();}public function render()diff --git a/app/Livewire/Source/Github/Change.php b/app/Livewire/Source/Github/Change.phpindex 07cef54f9f..0e84756f85 100644--- a/app/Livewire/Source/Github/Change.php+++ b/app/Livewire/Source/Github/Change.php@@ -116,14 +116,14 @@ class Change extends Component} else {$parameters = data_get(session('from'), 'parameters');$back = data_get(session('from'), 'back');- $environment_name = data_get($parameters, 'environment_name');+ $environment_uuid = data_get($parameters, 'environment_uuid');$project_uuid = data_get($parameters, 'project_uuid');$type = data_get($parameters, 'type');$destination = data_get($parameters, 'destination');session()->forget('from');return redirect()->route($back, [- 'environment_name' => $environment_name,+ 'environment_uuid' => $environment_uuid,'project_uuid' => $project_uuid,'type' => $type,'destination' => $destination,diff --git a/app/Models/Application.php b/app/Models/Application.phpindex c284528f1a..0e611931b3 100644--- a/app/Models/Application.php+++ b/app/Models/Application.php@@ -318,7 +318,7 @@ class Application extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.application.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'application_uuid' => data_get($this, 'uuid'),]);}@@ -331,7 +331,7 @@ class Application extends BaseModelif (data_get($this, 'environment.project.uuid')) {$route = route('project.application.scheduled-tasks', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'application_uuid' => data_get($this, 'uuid'),'task_uuid' => $task_uuid,]);diff --git a/app/Models/Project.php b/app/Models/Project.phpindex f27e6c2083..3b50b9b33e 100644--- a/app/Models/Project.php+++ b/app/Models/Project.php@@ -3,6 +3,7 @@namespace App\Models;use OpenApi\Attributes as OA;+use Visus\Cuid2\Cuid2;#[OA\Schema(description: 'Project model',@@ -24,8 +25,6 @@ class Project extends BaseModel{protected $guarded = [];- protected $appends = ['default_environment'];-public static function ownedByCurrentTeam(){return Project::whereTeamId(currentTeam()->id)->orderByRaw('LOWER(name)');@@ -40,6 +39,7 @@ class Project extends BaseModelEnvironment::create(['name' => 'production','project_id' => $project->id,+ 'uuid' => (string) new Cuid2,]);});static::deleting(function ($project) {@@ -140,18 +140,4 @@ class Project extends BaseModel{return $this->postgresqls()->get()->merge($this->redis()->get())->merge($this->mongodbs()->get())->merge($this->mysqls()->get())->merge($this->mariadbs()->get())->merge($this->keydbs()->get())->merge($this->dragonflies()->get())->merge($this->clickhouses()->get());}-- public function getDefaultEnvironmentAttribute()- {- $default = $this->environments()->where('name', 'production')->first();- if ($default) {- return $default->name;- }- $default = $this->environments()->get();- if ($default->count() > 0) {- return $default->sortBy('created_at')->first()->name;- }-- return null;- }}diff --git a/app/Models/Service.php b/app/Models/Service.phpindex 6d3d2024b0..1ba86a95f4 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -1132,7 +1132,7 @@ class Service extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.service.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'service_uuid' => data_get($this, 'uuid'),]);}@@ -1145,7 +1145,7 @@ class Service extends BaseModelif (data_get($this, 'environment.project.uuid')) {$route = route('project.service.scheduled-tasks', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'service_uuid' => data_get($this, 'uuid'),'task_uuid' => $task_uuid,]);diff --git a/app/Models/StandaloneClickhouse.php b/app/Models/StandaloneClickhouse.phpindex 6d66c68546..4776be4a84 100644--- a/app/Models/StandaloneClickhouse.php+++ b/app/Models/StandaloneClickhouse.php@@ -169,7 +169,7 @@ class StandaloneClickhouse extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandaloneDragonfly.php b/app/Models/StandaloneDragonfly.phpindex f7d83f0a31..6eaf81a140 100644--- a/app/Models/StandaloneDragonfly.php+++ b/app/Models/StandaloneDragonfly.php@@ -174,7 +174,7 @@ class StandaloneDragonfly extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandaloneKeydb.php b/app/Models/StandaloneKeydb.phpindex 083c743d95..b096d4bdeb 100644--- a/app/Models/StandaloneKeydb.php+++ b/app/Models/StandaloneKeydb.php@@ -174,7 +174,7 @@ class StandaloneKeydb extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandaloneMariadb.php b/app/Models/StandaloneMariadb.phpindex 833dad6c4f..0b19d13c70 100644--- a/app/Models/StandaloneMariadb.php+++ b/app/Models/StandaloneMariadb.php@@ -174,7 +174,7 @@ class StandaloneMariadb extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandaloneMongodb.php b/app/Models/StandaloneMongodb.phpindex dd8893180b..e4f400952b 100644--- a/app/Models/StandaloneMongodb.php+++ b/app/Models/StandaloneMongodb.php@@ -183,7 +183,7 @@ class StandaloneMongodb extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandaloneMysql.php b/app/Models/StandaloneMysql.phpindex 710fea1bc8..46556c04d8 100644--- a/app/Models/StandaloneMysql.php+++ b/app/Models/StandaloneMysql.php@@ -175,7 +175,7 @@ class StandaloneMysql extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.phpindex 4a457a6cf9..762afe8847 100644--- a/app/Models/StandalonePostgresql.php+++ b/app/Models/StandalonePostgresql.php@@ -170,7 +170,7 @@ class StandalonePostgresql extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/app/Models/StandaloneRedis.php b/app/Models/StandaloneRedis.phpindex 826bb951c5..5aeb283a18 100644--- a/app/Models/StandaloneRedis.php+++ b/app/Models/StandaloneRedis.php@@ -170,7 +170,7 @@ class StandaloneRedis extends BaseModelif (data_get($this, 'environment.project.uuid')) {return route('project.database.configuration', ['project_uuid' => data_get($this, 'environment.project.uuid'),- 'environment_name' => data_get($this, 'environment.name'),+ 'environment_uuid' => data_get($this, 'environment.uuid'),'database_uuid' => data_get($this, 'uuid'),]);}diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.phpindex f9733f63a8..f1c1ca99e8 100644--- a/resources/views/components/resources/breadcrumbs.blade.php+++ b/resources/views/components/resources/breadcrumbs.blade.php@@ -21,7 +21,9 @@<li><div class="flex items-center"><a class="text-xs truncate lg:text-sm"- href="{{ route('project.resource.index', ['environment_name' => $this->parameters['environment_name'], 'project_uuid' => $this->parameters['project_uuid']]) }}">{{ $this->parameters['environment_name'] }}</a>+ href="{{ route('project.resource.index', ['environment_uuid' => $this->parameters['environment_uuid'], 'project_uuid' => $this->parameters['project_uuid']]) }}">+ {{ data_get($resource, 'environment.name', $this->parameters['environment_uuid']) }}+ </a><svg aria-hidden="true" class="w-4 h-4 mx-1 font-bold dark:text-warning" fill="currentColor"viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd"diff --git a/resources/views/livewire/project/environment-edit.blade.php b/resources/views/livewire/project/environment-edit.blade.phpindex af5e686c48..bdea09ced3 100644--- a/resources/views/livewire/project/environment-edit.blade.php+++ b/resources/views/livewire/project/environment-edit.blade.php@@ -26,7 +26,7 @@<li><div class="flex items-center"><a class="text-xs truncate lg:text-sm"- href="{{ route('project.resource.index', ['environment_name' => $environment->name, 'project_uuid' => $project->uuid]) }}">+ href="{{ route('project.resource.index', ['environment_uuid' => $environment->uuid, 'project_uuid' => $project->uuid]) }}">{{ $environment->name }}</a></div>diff --git a/resources/views/livewire/project/resource/index.blade.php b/resources/views/livewire/project/resource/index.blade.phpindex a618e6db27..8973177f8a 100644--- a/resources/views/livewire/project/resource/index.blade.php+++ b/resources/views/livewire/project/resource/index.blade.php@@ -7,15 +7,15 @@<h1>Resources</h1>@if ($environment->isEmpty())<a class="button"- href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }}">+ href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}">Clone</a>@else- <a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }} "+ <a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}"class="button">+New</a><a class="button"- href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }}">+ href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}">Clone</a>@endif@@ -44,7 +44,7 @@</nav></div>@if ($environment->isEmpty())- <a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_name' => data_get($parameters, 'environment_name')]) }} "+ <a href="{{ route('project.resource.create', ['project_uuid' => data_get($parameters, 'project_uuid'), 'environment_uuid' => data_get($environment, 'uuid')]) }}"class="items-center justify-center box">+ Add New Resource</a>@else<div x-data="searchComponent()">