From 23e3ba62d5591de73b5804c76e46a49c0a6ac32b Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Sat, 14 Sep 2024 13:43:02 +0200 Subject: [PATCH] remove x-default from opengraph alternate --- src/SeoManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SeoManager.php b/src/SeoManager.php index 4404003..f80a32f 100644 --- a/src/SeoManager.php +++ b/src/SeoManager.php @@ -286,7 +286,10 @@ public function setAlternates(?array $value): static if ($this->opengraph) { $this->opengraph->locale = new Locale( locale: $this->opengraph->locale?->locale ?? App::getLocale(), - alternate: array_map(fn ($item) => $item->toOpenGraph(), $value ?? []) + alternate: collect($value) + ->where('hreflang', '!=', 'x-default') + ->map(fn ($item) => $item->toOpenGraph()) + ->toArray() ); }