1
0
Fork 0
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:
Ben Bjurstrom 2024-09-04 09:54:32 -07:00
parent 76d0f9efac
commit 7ff2ff9883

View file

@ -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
{ {
$this->url(request()->url()); if($origin){
$this->url(trim($origin, '/') . '/' . trim(request()->path(), '/'));
}else{
$this->url(request()->url());
}
return $this; return $this;
} }