1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-17 03:54:03 +00:00
This commit is contained in:
Ben Bjurstrom 2025-03-06 18:55:14 -05:00 committed by GitHub
commit f4b40ca38d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 2 deletions

View file

@ -224,9 +224,13 @@ class SEOManager
}
/** Append canonical URL tags to the document head. */
public function withUrl(): static
public function withUrl(?string $origin = null): static
{
$this->url(request()->url());
if ($origin) {
$this->url(trim($origin, '/') . '/' . trim(request()->path(), '/'));
} else {
$this->url(request()->url());
}
return $this;
}