$this->uri, 'domain' => $this->domain(), 'title' => $this->title, 'description' => $this->description, 'image' => $this->imageUrl, ]; } /** * The bare display host for the card (e.g. "nyt.com" from * "https://www.nyt.com/x"), so the frontend renders it without parsing URLs. */ private function domain(): string { $host = Uri::of($this->uri)->host(); return $host === null || $host === '' ? $this->uri : Str::chopStart($host, 'www.'); } }