workspaceUlid = $workspaceUlid; } #[Computed] public function fullUrl(): string { if (! $this->baseUrl) { return ''; } $params = array_filter([ 'utm_source' => $this->utmSource, 'utm_medium' => $this->utmMedium, 'utm_campaign' => $this->utmCampaign, 'utm_content' => $this->utmContent, 'utm_term' => $this->utmTerm, ]); if (! $params) { return $this->baseUrl; } $sep = str_contains($this->baseUrl, '?') ? '&' : '?'; return $this->baseUrl.$sep.http_build_query($params); } public function copyToClipboard(): void { $this->dispatch('copy-to-clipboard', text: $this->fullUrl); $this->copied = true; } public function createLink(): void { $url = $this->fullUrl; $wsUlid = $this->workspaceUlid; if (! $wsUlid) { $ws = current_workspace(); $wsUlid = $ws !== null ? $ws->ulid : ''; } $this->closeModal(); if ($wsUlid) { $this->dispatch('openModal', component: 'modals.create-link', arguments: [ 'workspaceUlid' => $wsUlid, 'prefillUrl' => $url, ]); } } public static function modalMaxWidth(): string { return 'lg'; } public function render(): View { return view('livewire.modals.utm-builder'); } }