mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-17 03:54:03 +00:00
Merge 0b2ff24cac into 0a2eef4db4
This commit is contained in:
commit
f4b40ca38d
2 changed files with 16 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue