Update app/Livewire/Project/Application/PreviewsCompose.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Andras Bacsai
2025-09-24 17:53:18 +02:00
committed by GitHub
parent 7b6b46454e
commit 4ce495d91e

View File

@@ -72,7 +72,8 @@ class PreviewsCompose extends Component
$template = $this->preview->application->preview_url_template;
$host = $url->getHost();
$schema = $url->getScheme();
$port = ":" . $url->getPort();
$portInt = $url->getPort();
$port = $portInt !== null ? ':' . $portInt : '';
$random = new Cuid2;
$preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);