Fix styling

This commit is contained in:
andrasbacsai 2024-07-25 11:31:59 +00:00 committed by github-actions[bot]
parent 6a4aa492c0
commit 96c4f5b8da
32 changed files with 55 additions and 55 deletions

View File

@ -739,7 +739,7 @@ private function create_application(Request $request, $type)
$application->isConfigurationChanged(true); $application->isConfigurationChanged(true);
if ($instantDeploy) { if ($instantDeploy) {
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
@ -835,7 +835,7 @@ private function create_application(Request $request, $type)
$application->isConfigurationChanged(true); $application->isConfigurationChanged(true);
if ($instantDeploy) { if ($instantDeploy) {
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
@ -927,7 +927,7 @@ private function create_application(Request $request, $type)
$application->isConfigurationChanged(true); $application->isConfigurationChanged(true);
if ($instantDeploy) { if ($instantDeploy) {
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
@ -947,7 +947,7 @@ private function create_application(Request $request, $type)
])); ]));
} elseif ($type === 'dockerfile') { } elseif ($type === 'dockerfile') {
if (! $request->has('name')) { if (! $request->has('name')) {
$request->offsetSet('name', 'dockerfile-'.new Cuid2()); $request->offsetSet('name', 'dockerfile-'.new Cuid2);
} }
$validator = customApiValidator($request->all(), [ $validator = customApiValidator($request->all(), [
sharedDataApplications(), sharedDataApplications(),
@ -1009,7 +1009,7 @@ private function create_application(Request $request, $type)
$application->isConfigurationChanged(true); $application->isConfigurationChanged(true);
if ($instantDeploy) { if ($instantDeploy) {
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
@ -1025,7 +1025,7 @@ private function create_application(Request $request, $type)
])); ]));
} elseif ($type === 'dockerimage') { } elseif ($type === 'dockerimage') {
if (! $request->has('name')) { if (! $request->has('name')) {
$request->offsetSet('name', 'docker-image-'.new Cuid2()); $request->offsetSet('name', 'docker-image-'.new Cuid2);
} }
$validator = customApiValidator($request->all(), [ $validator = customApiValidator($request->all(), [
sharedDataApplications(), sharedDataApplications(),
@ -1067,7 +1067,7 @@ private function create_application(Request $request, $type)
$application->isConfigurationChanged(true); $application->isConfigurationChanged(true);
if ($instantDeploy) { if ($instantDeploy) {
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
@ -1099,7 +1099,7 @@ private function create_application(Request $request, $type)
], 422); ], 422);
} }
if (! $request->has('name')) { if (! $request->has('name')) {
$request->offsetSet('name', 'service'.new Cuid2()); $request->offsetSet('name', 'service'.new Cuid2);
} }
$validator = customApiValidator($request->all(), [ $validator = customApiValidator($request->all(), [
sharedDataApplications(), sharedDataApplications(),
@ -2322,7 +2322,7 @@ public function action_deploy(Request $request)
return response()->json(['message' => 'Application not found.'], 404); return response()->json(['message' => 'Application not found.'], 404);
} }
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
@ -2479,7 +2479,7 @@ public function action_restart(Request $request)
return response()->json(['message' => 'Application not found.'], 404); return response()->json(['message' => 'Application not found.'], 404);
} }
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,

View File

@ -290,7 +290,7 @@ public function deploy_resource($resource, bool $force = false): array
} }
switch ($resource?->getMorphClass()) { switch ($resource?->getMorphClass()) {
case 'App\Models\Application': case 'App\Models\Application':
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $resource, application: $resource,
deployment_uuid: $deployment_uuid, deployment_uuid: $deployment_uuid,

View File

@ -103,7 +103,7 @@ public function manual(Request $request)
if ($x_bitbucket_event === 'repo:push') { if ($x_bitbucket_event === 'repo:push') {
if ($application->isDeployable()) { if ($application->isDeployable()) {
ray('Deploying '.$application->name.' with branch '.$branch); ray('Deploying '.$application->name.' with branch '.$branch);
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
deployment_uuid: $deployment_uuid, deployment_uuid: $deployment_uuid,
@ -127,7 +127,7 @@ public function manual(Request $request)
if ($x_bitbucket_event === 'pullrequest:created') { if ($x_bitbucket_event === 'pullrequest:created') {
if ($application->isPRDeployable()) { if ($application->isPRDeployable()) {
ray('Deploying preview for '.$application->name.' with branch '.$branch.' and base branch '.$base_branch.' and pull request id '.$pull_request_id); 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(); $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) { if (! $found) {
if ($application->build_pack === 'dockercompose') { if ($application->build_pack === 'dockercompose') {

View File

@ -123,7 +123,7 @@ public function manual(Request $request)
$is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files);
if ($is_watch_path_triggered || is_null($application->watch_paths)) { if ($is_watch_path_triggered || is_null($application->watch_paths)) {
ray('Deploying '.$application->name.' with branch '.$branch); ray('Deploying '.$application->name.' with branch '.$branch);
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
deployment_uuid: $deployment_uuid, deployment_uuid: $deployment_uuid,
@ -162,7 +162,7 @@ public function manual(Request $request)
if ($x_gitea_event === 'pull_request') { if ($x_gitea_event === 'pull_request') {
if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') { if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') {
if ($application->isPRDeployable()) { 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(); $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) { if (! $found) {
if ($application->build_pack === 'dockercompose') { if ($application->build_pack === 'dockercompose') {

View File

@ -128,7 +128,7 @@ public function manual(Request $request)
$is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files);
if ($is_watch_path_triggered || is_null($application->watch_paths)) { if ($is_watch_path_triggered || is_null($application->watch_paths)) {
ray('Deploying '.$application->name.' with branch '.$branch); ray('Deploying '.$application->name.' with branch '.$branch);
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
deployment_uuid: $deployment_uuid, deployment_uuid: $deployment_uuid,
@ -167,7 +167,7 @@ public function manual(Request $request)
if ($x_github_event === 'pull_request') { if ($x_github_event === 'pull_request') {
if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') { if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') {
if ($application->isPRDeployable()) { 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(); $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) { if (! $found) {
if ($application->build_pack === 'dockercompose') { if ($application->build_pack === 'dockercompose') {
@ -357,7 +357,7 @@ public function normal(Request $request)
$is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files);
if ($is_watch_path_triggered || is_null($application->watch_paths)) { if ($is_watch_path_triggered || is_null($application->watch_paths)) {
ray('Deploying '.$application->name.' with branch '.$branch); ray('Deploying '.$application->name.' with branch '.$branch);
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
deployment_uuid: $deployment_uuid, deployment_uuid: $deployment_uuid,
@ -396,7 +396,7 @@ public function normal(Request $request)
if ($x_github_event === 'pull_request') { if ($x_github_event === 'pull_request') {
if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') { if ($action === 'opened' || $action === 'synchronize' || $action === 'reopened') {
if ($application->isPRDeployable()) { 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(); $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) { if (! $found) {
ApplicationPreview::create([ ApplicationPreview::create([

View File

@ -137,7 +137,7 @@ public function manual(Request $request)
$is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files); $is_watch_path_triggered = $application->isWatchPathsTriggered($changed_files);
if ($is_watch_path_triggered || is_null($application->watch_paths)) { if ($is_watch_path_triggered || is_null($application->watch_paths)) {
ray('Deploying '.$application->name.' with branch '.$branch); ray('Deploying '.$application->name.' with branch '.$branch);
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $application, application: $application,
deployment_uuid: $deployment_uuid, deployment_uuid: $deployment_uuid,
@ -177,7 +177,7 @@ public function manual(Request $request)
if ($x_gitlab_event === 'merge_request') { if ($x_gitlab_event === 'merge_request') {
if ($action === 'open' || $action === 'opened' || $action === 'synchronize' || $action === 'reopened' || $action === 'reopen' || $action === 'update') { if ($action === 'open' || $action === 'opened' || $action === 'synchronize' || $action === 'reopened' || $action === 'reopen' || $action === 'update') {
if ($application->isPRDeployable()) { 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(); $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first();
if (! $found) { if (! $found) {
if ($application->build_pack === 'dockercompose') { if ($application->build_pack === 'dockercompose') {

View File

@ -52,7 +52,7 @@ public function mount()
if (request()->query('network_name')) { if (request()->query('network_name')) {
$this->network = request()->query('network_name'); $this->network = request()->query('network_name');
} else { } else {
$this->network = new Cuid2(); $this->network = new Cuid2;
} }
if ($this->servers->count() > 0) { if ($this->servers->count() > 0) {
$this->name = str("{$this->servers->first()->name}-{$this->network}")->kebab(); $this->name = str("{$this->servers->first()->name}-{$this->network}")->kebab();

View File

@ -39,7 +39,7 @@ public function __construct(
public function render() public function render()
{ {
if (is_null($this->id)) { if (is_null($this->id)) {
$this->id = new Cuid2(); $this->id = new Cuid2;
} }
if (is_null($this->name)) { if (is_null($this->name)) {

View File

@ -228,7 +228,7 @@ public function loadComposeFile($isInit = false)
public function generateDomain(string $serviceName) public function generateDomain(string $serviceName)
{ {
$uuid = new Cuid2(); $uuid = new Cuid2;
$domain = generateFqdn($this->application->destination->server, $uuid); $domain = generateFqdn($this->application->destination->server, $uuid);
$this->parsedServiceDomains[$serviceName]['domain'] = $domain; $this->parsedServiceDomains[$serviceName]['domain'] = $domain;
$this->application->docker_compose_domains = json_encode($this->parsedServiceDomains); $this->application->docker_compose_domains = json_encode($this->parsedServiceDomains);

View File

@ -102,7 +102,7 @@ public function deploy(bool $force_rebuild = false)
protected function setDeploymentUuid() protected function setDeploymentUuid()
{ {
$this->deploymentUuid = new Cuid2(); $this->deploymentUuid = new Cuid2;
$this->parameters['deployment_uuid'] = $this->deploymentUuid; $this->parameters['deployment_uuid'] = $this->deploymentUuid;
} }

View File

@ -85,7 +85,7 @@ public function generate_preview($preview_id)
$template = $this->application->preview_url_template; $template = $this->application->preview_url_template;
$host = $url->getHost(); $host = $url->getHost();
$schema = $url->getScheme(); $schema = $url->getScheme();
$random = new Cuid2(); $random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $preview->pull_request_id, $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() protected function setDeploymentUuid()
{ {
$this->deployment_uuid = new Cuid2(); $this->deployment_uuid = new Cuid2;
$this->parameters['deployment_uuid'] = $this->deployment_uuid; $this->parameters['deployment_uuid'] = $this->deployment_uuid;
} }

View File

@ -44,7 +44,7 @@ public function generate()
$template = $this->preview->application->preview_url_template; $template = $this->preview->application->preview_url_template;
$host = $url->getHost(); $host = $url->getHost();
$schema = $url->getScheme(); $schema = $url->getScheme();
$random = new Cuid2(); $random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $this->preview->pull_request_id, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $this->preview->pull_request_id, $preview_fqdn);

View File

@ -23,7 +23,7 @@ public function mount()
public function rollbackImage($commit) public function rollbackImage($commit)
{ {
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
queue_application_deployment( queue_application_deployment(
application: $this->application, application: $this->application,

View File

@ -47,7 +47,7 @@ public function mount($project_uuid)
$this->environment = $this->project->environments->where('name', $this->environment_name)->first(); $this->environment = $this->project->environments->where('name', $this->environment_name)->first();
$this->project_id = $this->project->id; $this->project_id = $this->project->id;
$this->servers = currentTeam()->servers; $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() public function render()
@ -106,7 +106,7 @@ public function clone(string $type)
$databases = $this->environment->databases(); $databases = $this->environment->databases();
$services = $this->environment->services; $services = $this->environment->services;
foreach ($applications as $application) { foreach ($applications as $application) {
$uuid = (string) new Cuid2(); $uuid = (string) new Cuid2;
$newApplication = $application->replicate()->fill([ $newApplication = $application->replicate()->fill([
'uuid' => $uuid, 'uuid' => $uuid,
'fqdn' => generateFqdn($this->server, $uuid), 'fqdn' => generateFqdn($this->server, $uuid),
@ -133,7 +133,7 @@ public function clone(string $type)
} }
} }
foreach ($databases as $database) { foreach ($databases as $database) {
$uuid = (string) new Cuid2(); $uuid = (string) new Cuid2;
$newDatabase = $database->replicate()->fill([ $newDatabase = $database->replicate()->fill([
'uuid' => $uuid, 'uuid' => $uuid,
'status' => 'exited', 'status' => 'exited',
@ -161,7 +161,7 @@ public function clone(string $type)
} }
} }
foreach ($services as $service) { foreach ($services as $service) {
$uuid = (string) new Cuid2(); $uuid = (string) new Cuid2;
$newService = $service->replicate()->fill([ $newService = $service->replicate()->fill([
'uuid' => $uuid, 'uuid' => $uuid,
'environment_id' => $environment->id, 'environment_id' => $environment->id,

View File

@ -48,7 +48,7 @@ public function submit()
$environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first();
ray($image, $tag); ray($image, $tag);
$application = Application::create([ $application = Application::create([
'name' => 'docker-image-'.new Cuid2(), 'name' => 'docker-image-'.new Cuid2,
'repository_project_id' => 0, 'repository_project_id' => 0,
'git_repository' => 'coollabsio/coolify', 'git_repository' => 'coollabsio/coolify',
'git_branch' => 'main', 'git_branch' => 'main',

View File

@ -53,7 +53,7 @@ public function submit()
$port = 80; $port = 80;
} }
$application = Application::create([ $application = Application::create([
'name' => 'dockerfile-'.new Cuid2(), 'name' => 'dockerfile-'.new Cuid2,
'repository_project_id' => 0, 'repository_project_id' => 0,
'git_repository' => 'coollabsio/coolify', 'git_repository' => 'coollabsio/coolify',
'git_branch' => 'main', 'git_branch' => 'main',

View File

@ -22,7 +22,7 @@ class Danger extends Component
public function mount() public function mount()
{ {
$this->modalId = new Cuid2(); $this->modalId = new Cuid2;
$parameters = get_route_parameters(); $parameters = get_route_parameters();
$this->projectUuid = data_get($parameters, 'project_uuid'); $this->projectUuid = data_get($parameters, 'project_uuid');
$this->environmentName = data_get($parameters, 'environment_name'); $this->environmentName = data_get($parameters, 'environment_name');

View File

@ -67,7 +67,7 @@ public function redeploy(int $network_id, int $server_id)
return; return;
} }
$deployment_uuid = new Cuid2(); $deployment_uuid = new Cuid2;
$server = Server::find($server_id); $server = Server::find($server_id);
$destination = StandaloneDocker::find($network_id); $destination = StandaloneDocker::find($network_id);
queue_application_deployment( queue_application_deployment(

View File

@ -39,7 +39,7 @@ public function mount()
if (str($this->resourceClass)->contains($resourceWithPreviews) && ! $simpleDockerfile) { if (str($this->resourceClass)->contains($resourceWithPreviews) && ! $simpleDockerfile) {
$this->showPreview = true; $this->showPreview = true;
} }
$this->modalId = new Cuid2(); $this->modalId = new Cuid2;
$this->sortMe(); $this->sortMe();
$this->getDevView(); $this->getDevView();
} }

View File

@ -51,7 +51,7 @@ public function mount()
if ($this->env->getMorphClass() === 'App\Models\SharedEnvironmentVariable') { if ($this->env->getMorphClass() === 'App\Models\SharedEnvironmentVariable') {
$this->isSharedVariable = true; $this->isSharedVariable = true;
} }
$this->modalId = new Cuid2(); $this->modalId = new Cuid2;
$this->parameters = get_route_parameters(); $this->parameters = get_route_parameters();
$this->checkEnvs(); $this->checkEnvs();
} }

View File

@ -39,7 +39,7 @@ public function cloneTo($destination_id)
if (! $new_destination) { if (! $new_destination) {
return $this->addError('destination_id', 'Destination not found.'); return $this->addError('destination_id', 'Destination not found.');
} }
$uuid = (string) new Cuid2(); $uuid = (string) new Cuid2;
$server = $new_destination->server; $server = $new_destination->server;
if ($this->resource->getMorphClass() === 'App\Models\Application') { if ($this->resource->getMorphClass() === 'App\Models\Application') {
$new_resource = $this->resource->replicate()->fill([ $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\StandaloneDragonfly' ||
$this->resource->getMorphClass() === 'App\Models\StandaloneClickhouse' $this->resource->getMorphClass() === 'App\Models\StandaloneClickhouse'
) { ) {
$uuid = (string) new Cuid2(); $uuid = (string) new Cuid2;
$new_resource = $this->resource->replicate()->fill([ $new_resource = $this->resource->replicate()->fill([
'uuid' => $uuid, 'uuid' => $uuid,
'name' => $this->resource->name.'-clone-'.$uuid, 'name' => $this->resource->name.'-clone-'.$uuid,
@ -121,7 +121,7 @@ public function cloneTo($destination_id)
return redirect()->to($route); return redirect()->to($route);
} elseif ($this->resource->type() === 'service') { } elseif ($this->resource->type() === 'service') {
$uuid = (string) new Cuid2(); $uuid = (string) new Cuid2;
$new_resource = $this->resource->replicate()->fill([ $new_resource = $this->resource->replicate()->fill([
'uuid' => $uuid, 'uuid' => $uuid,
'name' => $this->resource->name.'-clone-'.$uuid, 'name' => $this->resource->name.'-clone-'.$uuid,

View File

@ -47,7 +47,7 @@ public function mount()
$this->resource = Service::where('uuid', $this->parameters['service_uuid'])->firstOrFail(); $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(); $this->task = ModelsScheduledTask::where('uuid', request()->route('task_uuid'))->first();
} }

View File

@ -1282,7 +1282,7 @@ public function generate_preview_fqdn(int $pull_request_id)
$template = $this->preview_url_template; $template = $this->preview_url_template;
$host = $url->getHost(); $host = $url->getHost();
$schema = $url->getScheme(); $schema = $url->getScheme();
$random = new Cuid2(); $random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn);

View File

@ -49,7 +49,7 @@ public function generate_preview_fqdn_compose()
$template = $this->application->preview_url_template; $template = $this->application->preview_url_template;
$host = $url->getHost(); $host = $url->getHost();
$schema = $url->getScheme(); $schema = $url->getScheme();
$random = new Cuid2(); $random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $this->pull_request_id, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $this->pull_request_id, $preview_fqdn);

View File

@ -14,7 +14,7 @@ protected static function boot()
static::creating(function (Model $model) { static::creating(function (Model $model) {
// Generate a UUID if one isn't set // Generate a UUID if one isn't set
if (! $model->uuid) { if (! $model->uuid) {
$model->uuid = (string) new Cuid2(); $model->uuid = (string) new Cuid2;
} }
}); });
} }

View File

@ -30,7 +30,7 @@ public function __construct(
public function render(): View|Closure|string public function render(): View|Closure|string
{ {
if (is_null($this->id)) { if (is_null($this->id)) {
$this->id = new Cuid2(); $this->id = new Cuid2;
} }
if (is_null($this->name)) { if (is_null($this->name)) {
$this->name = $this->id; $this->name = $this->id;

View File

@ -27,7 +27,7 @@ public function __construct(
public function render(): View|Closure|string public function render(): View|Closure|string
{ {
if (is_null($this->id)) { if (is_null($this->id)) {
$this->id = new Cuid2(); $this->id = new Cuid2;
} }
if (is_null($this->name)) { if (is_null($this->name)) {
$this->name = $this->id; $this->name = $this->id;

View File

@ -30,7 +30,7 @@ public function __construct(
public function render(): View|Closure|string public function render(): View|Closure|string
{ {
if (is_null($this->id)) { if (is_null($this->id)) {
$this->id = new Cuid2(); $this->id = new Cuid2;
} }
if (is_null($this->name)) { if (is_null($this->name)) {
$this->name = $this->id; $this->name = $this->id;

View File

@ -41,7 +41,7 @@ public function __construct(
public function render(): View|Closure|string public function render(): View|Closure|string
{ {
if (is_null($this->id)) { if (is_null($this->id)) {
$this->id = new Cuid2(); $this->id = new Cuid2;
} }
if (is_null($this->name)) { if (is_null($this->name)) {
$this->name = $this->id; $this->name = $this->id;

View File

@ -14,7 +14,7 @@
function generate_database_name(string $type): string function generate_database_name(string $type): string
{ {
$cuid = new Cuid2(); $cuid = new Cuid2;
return $type.'-database-'.$cuid; return $type.'-database-'.$cuid;
} }

View File

@ -338,7 +338,7 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
foreach ($domains as $loop => $domain) { foreach ($domains as $loop => $domain) {
try { try {
if ($generate_unique_uuid) { if ($generate_unique_uuid) {
$uuid = new Cuid2(); $uuid = new Cuid2;
} }
$url = Url::fromString($domain); $url = Url::fromString($domain);

View File

@ -200,7 +200,7 @@ function generate_random_name(?string $cuid = null): string
] ]
); );
if (is_null($cuid)) { if (is_null($cuid)) {
$cuid = new Cuid2(); $cuid = new Cuid2;
} }
return Str::kebab("{$generator->getName()}-$cuid"); 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 function generate_application_name(string $git_repository, string $git_branch, ?string $cuid = null): string
{ {
if (is_null($cuid)) { if (is_null($cuid)) {
$cuid = new Cuid2(); $cuid = new Cuid2;
} }
return Str::kebab("$git_repository:$git_branch-$cuid"); 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; $template = $resource->preview_url_template;
$host = $url->getHost(); $host = $url->getHost();
$schema = $url->getScheme(); $schema = $url->getScheme();
$random = new Cuid2(); $random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template); $preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn); $preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn); $preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn);