From 96c4f5b8da278d809c7113fbd432c3de6a1ba93a Mon Sep 17 00:00:00 2001 From: andrasbacsai Date: Thu, 25 Jul 2024 11:31:59 +0000 Subject: [PATCH] Fix styling --- .../Api/ApplicationsController.php | 20 +++++++++---------- app/Http/Controllers/Api/DeployController.php | 2 +- app/Http/Controllers/Webhook/Bitbucket.php | 4 ++-- app/Http/Controllers/Webhook/Gitea.php | 4 ++-- app/Http/Controllers/Webhook/Github.php | 8 ++++---- app/Http/Controllers/Webhook/Gitlab.php | 4 ++-- app/Livewire/Destination/New/Docker.php | 2 +- app/Livewire/MonacoEditor.php | 2 +- app/Livewire/Project/Application/General.php | 2 +- app/Livewire/Project/Application/Heading.php | 2 +- app/Livewire/Project/Application/Previews.php | 4 ++-- .../Project/Application/PreviewsCompose.php | 2 +- app/Livewire/Project/Application/Rollback.php | 2 +- app/Livewire/Project/CloneMe.php | 8 ++++---- app/Livewire/Project/New/DockerImage.php | 2 +- app/Livewire/Project/New/SimpleDockerfile.php | 2 +- app/Livewire/Project/Shared/Danger.php | 2 +- app/Livewire/Project/Shared/Destination.php | 2 +- .../Shared/EnvironmentVariable/All.php | 2 +- .../Shared/EnvironmentVariable/Show.php | 2 +- .../Project/Shared/ResourceOperations.php | 6 +++--- .../Project/Shared/ScheduledTask/Show.php | 2 +- app/Models/Application.php | 2 +- app/Models/ApplicationPreview.php | 2 +- app/Models/BaseModel.php | 2 +- app/View/Components/Forms/Datalist.php | 2 +- app/View/Components/Forms/Input.php | 2 +- app/View/Components/Forms/Select.php | 2 +- app/View/Components/Forms/Textarea.php | 2 +- bootstrap/helpers/databases.php | 2 +- bootstrap/helpers/docker.php | 2 +- bootstrap/helpers/shared.php | 6 +++--- 32 files changed, 55 insertions(+), 55 deletions(-) diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php index a83c17874..cd4d724b4 100644 --- a/app/Http/Controllers/Api/ApplicationsController.php +++ b/app/Http/Controllers/Api/ApplicationsController.php @@ -739,7 +739,7 @@ private function create_application(Request $request, $type) $application->isConfigurationChanged(true); if ($instantDeploy) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, @@ -835,7 +835,7 @@ private function create_application(Request $request, $type) $application->isConfigurationChanged(true); if ($instantDeploy) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, @@ -927,7 +927,7 @@ private function create_application(Request $request, $type) $application->isConfigurationChanged(true); if ($instantDeploy) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, @@ -947,7 +947,7 @@ private function create_application(Request $request, $type) ])); } elseif ($type === 'dockerfile') { if (! $request->has('name')) { - $request->offsetSet('name', 'dockerfile-'.new Cuid2()); + $request->offsetSet('name', 'dockerfile-'.new Cuid2); } $validator = customApiValidator($request->all(), [ sharedDataApplications(), @@ -1009,7 +1009,7 @@ private function create_application(Request $request, $type) $application->isConfigurationChanged(true); if ($instantDeploy) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, @@ -1025,7 +1025,7 @@ private function create_application(Request $request, $type) ])); } elseif ($type === 'dockerimage') { if (! $request->has('name')) { - $request->offsetSet('name', 'docker-image-'.new Cuid2()); + $request->offsetSet('name', 'docker-image-'.new Cuid2); } $validator = customApiValidator($request->all(), [ sharedDataApplications(), @@ -1067,7 +1067,7 @@ private function create_application(Request $request, $type) $application->isConfigurationChanged(true); if ($instantDeploy) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, @@ -1099,7 +1099,7 @@ private function create_application(Request $request, $type) ], 422); } if (! $request->has('name')) { - $request->offsetSet('name', 'service'.new Cuid2()); + $request->offsetSet('name', 'service'.new Cuid2); } $validator = customApiValidator($request->all(), [ sharedDataApplications(), @@ -2322,7 +2322,7 @@ public function action_deploy(Request $request) return response()->json(['message' => 'Application not found.'], 404); } - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, @@ -2479,7 +2479,7 @@ public function action_restart(Request $request) return response()->json(['message' => 'Application not found.'], 404); } - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, diff --git a/app/Http/Controllers/Api/DeployController.php b/app/Http/Controllers/Api/DeployController.php index 838d42df5..437162058 100644 --- a/app/Http/Controllers/Api/DeployController.php +++ b/app/Http/Controllers/Api/DeployController.php @@ -290,7 +290,7 @@ public function deploy_resource($resource, bool $force = false): array } switch ($resource?->getMorphClass()) { case 'App\Models\Application': - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $resource, deployment_uuid: $deployment_uuid, diff --git a/app/Http/Controllers/Webhook/Bitbucket.php b/app/Http/Controllers/Webhook/Bitbucket.php index 720bf85bb..ef85d59e3 100644 --- a/app/Http/Controllers/Webhook/Bitbucket.php +++ b/app/Http/Controllers/Webhook/Bitbucket.php @@ -103,7 +103,7 @@ public function manual(Request $request) if ($x_bitbucket_event === 'repo:push') { if ($application->isDeployable()) { ray('Deploying '.$application->name.' with branch '.$branch); - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, deployment_uuid: $deployment_uuid, @@ -127,7 +127,7 @@ public function manual(Request $request) if ($x_bitbucket_event === 'pullrequest:created') { if ($application->isPRDeployable()) { ray('Deploying preview for '.$application->name.' with branch '.$branch.' and base branch '.$base_branch.' and pull request id '.$pull_request_id); - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if (! $found) { if ($application->build_pack === 'dockercompose') { diff --git a/app/Http/Controllers/Webhook/Gitea.php b/app/Http/Controllers/Webhook/Gitea.php index 26ba7a0e2..e042b74c9 100644 --- a/app/Http/Controllers/Webhook/Gitea.php +++ b/app/Http/Controllers/Webhook/Gitea.php @@ -123,7 +123,7 @@ public function manual(Request $request) $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); if ($is_watch_path_triggered || is_null($application->watch_paths)) { ray('Deploying '.$application->name.' with branch '.$branch); - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, deployment_uuid: $deployment_uuid, @@ -162,7 +162,7 @@ public function manual(Request $request) if ($x_gitea_event === 'pull_request') { if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') { if ($application->isPRDeployable()) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if (! $found) { if ($application->build_pack === 'dockercompose') { diff --git a/app/Http/Controllers/Webhook/Github.php b/app/Http/Controllers/Webhook/Github.php index 56af8644f..5f3ba933b 100644 --- a/app/Http/Controllers/Webhook/Github.php +++ b/app/Http/Controllers/Webhook/Github.php @@ -128,7 +128,7 @@ public function manual(Request $request) $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); if ($is_watch_path_triggered || is_null($application->watch_paths)) { ray('Deploying '.$application->name.' with branch '.$branch); - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, deployment_uuid: $deployment_uuid, @@ -167,7 +167,7 @@ public function manual(Request $request) if ($x_github_event === 'pull_request') { if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') { if ($application->isPRDeployable()) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if (! $found) { if ($application->build_pack === 'dockercompose') { @@ -357,7 +357,7 @@ public function normal(Request $request) $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); if ($is_watch_path_triggered || is_null($application->watch_paths)) { ray('Deploying '.$application->name.' with branch '.$branch); - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, deployment_uuid: $deployment_uuid, @@ -396,7 +396,7 @@ public function normal(Request $request) if ($x_github_event === 'pull_request') { if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') { if ($application->isPRDeployable()) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if (! $found) { ApplicationPreview::create([ diff --git a/app/Http/Controllers/Webhook/Gitlab.php b/app/Http/Controllers/Webhook/Gitlab.php index ad0142a64..ec7f51a0d 100644 --- a/app/Http/Controllers/Webhook/Gitlab.php +++ b/app/Http/Controllers/Webhook/Gitlab.php @@ -137,7 +137,7 @@ public function manual(Request $request) $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); if ($is_watch_path_triggered || is_null($application->watch_paths)) { ray('Deploying '.$application->name.' with branch '.$branch); - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $application, deployment_uuid: $deployment_uuid, @@ -177,7 +177,7 @@ public function manual(Request $request) if ($x_gitlab_event === 'merge_request') { if ($action === 'open' || $action === 'opened' || $action === 'synchronize' || $action === 'reopened' || $action === 'reopen' || $action === 'update') { if ($application->isPRDeployable()) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if (! $found) { if ($application->build_pack === 'dockercompose') { diff --git a/app/Livewire/Destination/New/Docker.php b/app/Livewire/Destination/New/Docker.php index 2238be22d..4fc938df8 100644 --- a/app/Livewire/Destination/New/Docker.php +++ b/app/Livewire/Destination/New/Docker.php @@ -52,7 +52,7 @@ public function mount() if (request()->query('network_name')) { $this->network = request()->query('network_name'); } else { - $this->network = new Cuid2(); + $this->network = new Cuid2; } if ($this->servers->count() > 0) { $this->name = str("{$this->servers->first()->name}-{$this->network}")->kebab(); diff --git a/app/Livewire/MonacoEditor.php b/app/Livewire/MonacoEditor.php index 52b501f18..42d276e64 100644 --- a/app/Livewire/MonacoEditor.php +++ b/app/Livewire/MonacoEditor.php @@ -39,7 +39,7 @@ public function __construct( public function render() { if (is_null($this->id)) { - $this->id = new Cuid2(); + $this->id = new Cuid2; } if (is_null($this->name)) { diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index b201f9c38..395c45524 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -228,7 +228,7 @@ public function loadComposeFile($isInit = false) public function generateDomain(string $serviceName) { - $uuid = new Cuid2(); + $uuid = new Cuid2; $domain = generateFqdn($this->application->destination->server, $uuid); $this->parsedServiceDomains[$serviceName]['domain'] = $domain; $this->application->docker_compose_domains = json_encode($this->parsedServiceDomains); diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php index 415b44ed4..b5f01587a 100644 --- a/app/Livewire/Project/Application/Heading.php +++ b/app/Livewire/Project/Application/Heading.php @@ -102,7 +102,7 @@ public function deploy(bool $force_rebuild = false) protected function setDeploymentUuid() { - $this->deploymentUuid = new Cuid2(); + $this->deploymentUuid = new Cuid2; $this->parameters['deployment_uuid'] = $this->deploymentUuid; } diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php index 36838d3a5..30bc0a9d1 100644 --- a/app/Livewire/Project/Application/Previews.php +++ b/app/Livewire/Project/Application/Previews.php @@ -85,7 +85,7 @@ public function generate_preview($preview_id) $template = $this->application->preview_url_template; $host = $url->getHost(); $schema = $url->getScheme(); - $random = new Cuid2(); + $random = new Cuid2; $preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $preview->pull_request_id, $preview_fqdn); @@ -170,7 +170,7 @@ public function deploy(int $pull_request_id, ?string $pull_request_html_url = nu protected function setDeploymentUuid() { - $this->deployment_uuid = new Cuid2(); + $this->deployment_uuid = new Cuid2; $this->parameters['deployment_uuid'] = $this->deployment_uuid; } diff --git a/app/Livewire/Project/Application/PreviewsCompose.php b/app/Livewire/Project/Application/PreviewsCompose.php index 2cb8fd6cf..b3e838bb3 100644 --- a/app/Livewire/Project/Application/PreviewsCompose.php +++ b/app/Livewire/Project/Application/PreviewsCompose.php @@ -44,7 +44,7 @@ public function generate() $template = $this->preview->application->preview_url_template; $host = $url->getHost(); $schema = $url->getScheme(); - $random = new Cuid2(); + $random = new Cuid2; $preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $this->preview->pull_request_id, $preview_fqdn); diff --git a/app/Livewire/Project/Application/Rollback.php b/app/Livewire/Project/Application/Rollback.php index a9a4d2768..1e58a1458 100644 --- a/app/Livewire/Project/Application/Rollback.php +++ b/app/Livewire/Project/Application/Rollback.php @@ -23,7 +23,7 @@ public function mount() public function rollbackImage($commit) { - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; queue_application_deployment( application: $this->application, diff --git a/app/Livewire/Project/CloneMe.php b/app/Livewire/Project/CloneMe.php index daa766828..4d2bc6589 100644 --- a/app/Livewire/Project/CloneMe.php +++ b/app/Livewire/Project/CloneMe.php @@ -47,7 +47,7 @@ public function mount($project_uuid) $this->environment = $this->project->environments->where('name', $this->environment_name)->first(); $this->project_id = $this->project->id; $this->servers = currentTeam()->servers; - $this->newName = str($this->project->name.'-clone-'.(string) new Cuid2())->slug(); + $this->newName = str($this->project->name.'-clone-'.(string) new Cuid2)->slug(); } public function render() @@ -106,7 +106,7 @@ public function clone(string $type) $databases = $this->environment->databases(); $services = $this->environment->services; foreach ($applications as $application) { - $uuid = (string) new Cuid2(); + $uuid = (string) new Cuid2; $newApplication = $application->replicate()->fill([ 'uuid' => $uuid, 'fqdn' => generateFqdn($this->server, $uuid), @@ -133,7 +133,7 @@ public function clone(string $type) } } foreach ($databases as $database) { - $uuid = (string) new Cuid2(); + $uuid = (string) new Cuid2; $newDatabase = $database->replicate()->fill([ 'uuid' => $uuid, 'status' => 'exited', @@ -161,7 +161,7 @@ public function clone(string $type) } } foreach ($services as $service) { - $uuid = (string) new Cuid2(); + $uuid = (string) new Cuid2; $newService = $service->replicate()->fill([ 'uuid' => $uuid, 'environment_id' => $environment->id, diff --git a/app/Livewire/Project/New/DockerImage.php b/app/Livewire/Project/New/DockerImage.php index 2fa48ad7a..d3f5b5261 100644 --- a/app/Livewire/Project/New/DockerImage.php +++ b/app/Livewire/Project/New/DockerImage.php @@ -48,7 +48,7 @@ public function submit() $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); ray($image, $tag); $application = Application::create([ - 'name' => 'docker-image-'.new Cuid2(), + 'name' => 'docker-image-'.new Cuid2, 'repository_project_id' => 0, 'git_repository' => 'coollabsio/coolify', 'git_branch' => 'main', diff --git a/app/Livewire/Project/New/SimpleDockerfile.php b/app/Livewire/Project/New/SimpleDockerfile.php index 883b629fa..3c7f42329 100644 --- a/app/Livewire/Project/New/SimpleDockerfile.php +++ b/app/Livewire/Project/New/SimpleDockerfile.php @@ -53,7 +53,7 @@ public function submit() $port = 80; } $application = Application::create([ - 'name' => 'dockerfile-'.new Cuid2(), + 'name' => 'dockerfile-'.new Cuid2, 'repository_project_id' => 0, 'git_repository' => 'coollabsio/coolify', 'git_branch' => 'main', diff --git a/app/Livewire/Project/Shared/Danger.php b/app/Livewire/Project/Shared/Danger.php index 839d6d89e..5f0178be4 100644 --- a/app/Livewire/Project/Shared/Danger.php +++ b/app/Livewire/Project/Shared/Danger.php @@ -22,7 +22,7 @@ class Danger extends Component public function mount() { - $this->modalId = new Cuid2(); + $this->modalId = new Cuid2; $parameters = get_route_parameters(); $this->projectUuid = data_get($parameters, 'project_uuid'); $this->environmentName = data_get($parameters, 'environment_name'); diff --git a/app/Livewire/Project/Shared/Destination.php b/app/Livewire/Project/Shared/Destination.php index b2528e076..a2c018beb 100644 --- a/app/Livewire/Project/Shared/Destination.php +++ b/app/Livewire/Project/Shared/Destination.php @@ -67,7 +67,7 @@ public function redeploy(int $network_id, int $server_id) return; } - $deployment_uuid = new Cuid2(); + $deployment_uuid = new Cuid2; $server = Server::find($server_id); $destination = StandaloneDocker::find($network_id); queue_application_deployment( diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/All.php b/app/Livewire/Project/Shared/EnvironmentVariable/All.php index b7660aa61..5fceda808 100644 --- a/app/Livewire/Project/Shared/EnvironmentVariable/All.php +++ b/app/Livewire/Project/Shared/EnvironmentVariable/All.php @@ -39,7 +39,7 @@ public function mount() if (str($this->resourceClass)->contains($resourceWithPreviews) && ! $simpleDockerfile) { $this->showPreview = true; } - $this->modalId = new Cuid2(); + $this->modalId = new Cuid2; $this->sortMe(); $this->getDevView(); } diff --git a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php index 279c809f3..8c8c1be7b 100644 --- a/app/Livewire/Project/Shared/EnvironmentVariable/Show.php +++ b/app/Livewire/Project/Shared/EnvironmentVariable/Show.php @@ -51,7 +51,7 @@ public function mount() if ($this->env->getMorphClass() === 'App\Models\SharedEnvironmentVariable') { $this->isSharedVariable = true; } - $this->modalId = new Cuid2(); + $this->modalId = new Cuid2; $this->parameters = get_route_parameters(); $this->checkEnvs(); } diff --git a/app/Livewire/Project/Shared/ResourceOperations.php b/app/Livewire/Project/Shared/ResourceOperations.php index 466104d24..ec09eb80f 100644 --- a/app/Livewire/Project/Shared/ResourceOperations.php +++ b/app/Livewire/Project/Shared/ResourceOperations.php @@ -39,7 +39,7 @@ public function cloneTo($destination_id) if (! $new_destination) { return $this->addError('destination_id', 'Destination not found.'); } - $uuid = (string) new Cuid2(); + $uuid = (string) new Cuid2; $server = $new_destination->server; if ($this->resource->getMorphClass() === 'App\Models\Application') { $new_resource = $this->resource->replicate()->fill([ @@ -87,7 +87,7 @@ public function cloneTo($destination_id) $this->resource->getMorphClass() === 'App\Models\StandaloneDragonfly' || $this->resource->getMorphClass() === 'App\Models\StandaloneClickhouse' ) { - $uuid = (string) new Cuid2(); + $uuid = (string) new Cuid2; $new_resource = $this->resource->replicate()->fill([ 'uuid' => $uuid, 'name' => $this->resource->name.'-clone-'.$uuid, @@ -121,7 +121,7 @@ public function cloneTo($destination_id) return redirect()->to($route); } elseif ($this->resource->type() === 'service') { - $uuid = (string) new Cuid2(); + $uuid = (string) new Cuid2; $new_resource = $this->resource->replicate()->fill([ 'uuid' => $uuid, 'name' => $this->resource->name.'-clone-'.$uuid, diff --git a/app/Livewire/Project/Shared/ScheduledTask/Show.php b/app/Livewire/Project/Shared/ScheduledTask/Show.php index c1b2bc989..8be4ff643 100644 --- a/app/Livewire/Project/Shared/ScheduledTask/Show.php +++ b/app/Livewire/Project/Shared/ScheduledTask/Show.php @@ -47,7 +47,7 @@ public function mount() $this->resource = Service::where('uuid', $this->parameters['service_uuid'])->firstOrFail(); } - $this->modalId = new Cuid2(); + $this->modalId = new Cuid2; $this->task = ModelsScheduledTask::where('uuid', request()->route('task_uuid'))->first(); } diff --git a/app/Models/Application.php b/app/Models/Application.php index 63fae03b6..f13805ad5 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -1282,7 +1282,7 @@ public function generate_preview_fqdn(int $pull_request_id) $template = $this->preview_url_template; $host = $url->getHost(); $schema = $url->getScheme(); - $random = new Cuid2(); + $random = new Cuid2; $preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn); diff --git a/app/Models/ApplicationPreview.php b/app/Models/ApplicationPreview.php index 8f5b6d000..2825f984f 100644 --- a/app/Models/ApplicationPreview.php +++ b/app/Models/ApplicationPreview.php @@ -49,7 +49,7 @@ public function generate_preview_fqdn_compose() $template = $this->application->preview_url_template; $host = $url->getHost(); $schema = $url->getScheme(); - $random = new Cuid2(); + $random = new Cuid2; $preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $this->pull_request_id, $preview_fqdn); diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index d29328f07..17201ea6e 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -14,7 +14,7 @@ protected static function boot() static::creating(function (Model $model) { // Generate a UUID if one isn't set if (! $model->uuid) { - $model->uuid = (string) new Cuid2(); + $model->uuid = (string) new Cuid2; } }); } diff --git a/app/View/Components/Forms/Datalist.php b/app/View/Components/Forms/Datalist.php index 742d5a005..25643753d 100644 --- a/app/View/Components/Forms/Datalist.php +++ b/app/View/Components/Forms/Datalist.php @@ -30,7 +30,7 @@ public function __construct( public function render(): View|Closure|string { if (is_null($this->id)) { - $this->id = new Cuid2(); + $this->id = new Cuid2; } if (is_null($this->name)) { $this->name = $this->id; diff --git a/app/View/Components/Forms/Input.php b/app/View/Components/Forms/Input.php index 017049e28..6c9378cac 100644 --- a/app/View/Components/Forms/Input.php +++ b/app/View/Components/Forms/Input.php @@ -27,7 +27,7 @@ public function __construct( public function render(): View|Closure|string { if (is_null($this->id)) { - $this->id = new Cuid2(); + $this->id = new Cuid2; } if (is_null($this->name)) { $this->name = $this->id; diff --git a/app/View/Components/Forms/Select.php b/app/View/Components/Forms/Select.php index 33d1c86a0..dd5ba66b7 100644 --- a/app/View/Components/Forms/Select.php +++ b/app/View/Components/Forms/Select.php @@ -30,7 +30,7 @@ public function __construct( public function render(): View|Closure|string { if (is_null($this->id)) { - $this->id = new Cuid2(); + $this->id = new Cuid2; } if (is_null($this->name)) { $this->name = $this->id; diff --git a/app/View/Components/Forms/Textarea.php b/app/View/Components/Forms/Textarea.php index ca80fc197..3f887877c 100644 --- a/app/View/Components/Forms/Textarea.php +++ b/app/View/Components/Forms/Textarea.php @@ -41,7 +41,7 @@ public function __construct( public function render(): View|Closure|string { if (is_null($this->id)) { - $this->id = new Cuid2(); + $this->id = new Cuid2; } if (is_null($this->name)) { $this->name = $this->id; diff --git a/bootstrap/helpers/databases.php b/bootstrap/helpers/databases.php index 0e7ce9dbc..b8dcc1f3c 100644 --- a/bootstrap/helpers/databases.php +++ b/bootstrap/helpers/databases.php @@ -14,7 +14,7 @@ function generate_database_name(string $type): string { - $cuid = new Cuid2(); + $cuid = new Cuid2; return $type.'-database-'.$cuid; } diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 14460ac50..f32100f88 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -338,7 +338,7 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_ foreach ($domains as $loop => $domain) { try { if ($generate_unique_uuid) { - $uuid = new Cuid2(); + $uuid = new Cuid2; } $url = Url::fromString($domain); diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index f722b544c..9c2b1fcb5 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -200,7 +200,7 @@ function generate_random_name(?string $cuid = null): string ] ); if (is_null($cuid)) { - $cuid = new Cuid2(); + $cuid = new Cuid2; } return Str::kebab("{$generator->getName()}-$cuid"); @@ -236,7 +236,7 @@ function formatPrivateKey(string $privateKey) function generate_application_name(string $git_repository, string $git_branch, ?string $cuid = null): string { if (is_null($cuid)) { - $cuid = new Cuid2(); + $cuid = new Cuid2; } return Str::kebab("$git_repository:$git_branch-$cuid"); @@ -2015,7 +2015,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal $template = $resource->preview_url_template; $host = $url->getHost(); $schema = $url->getScheme(); - $random = new Cuid2(); + $random = new Cuid2; $preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn);