mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
Update withUrl
This commit is contained in:
parent
76d0f9efac
commit
7ff2ff9883
1 changed files with 6 additions and 2 deletions
|
|
@ -224,9 +224,13 @@ class SEOManager
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Append canonical URL tags to the document head. */
|
/** Append canonical URL tags to the document head. */
|
||||||
public function withUrl(): static
|
public function withUrl(?string $origin = null): static
|
||||||
{
|
{
|
||||||
|
if($origin){
|
||||||
|
$this->url(trim($origin, '/') . '/' . trim(request()->path(), '/'));
|
||||||
|
}else{
|
||||||
$this->url(request()->url());
|
$this->url(request()->url());
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue