1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 01:44:03 +00:00

Support extra tags

This commit is contained in:
Samuel Štancl 2021-05-26 13:02:20 +02:00
parent 21452f538b
commit 007a555d57
3 changed files with 41 additions and 0 deletions

View file

@ -37,6 +37,9 @@ class SEOManager
/** Metadata for additional features. */
protected array $meta = [];
/** Extra head tags. */
protected array $tags = [];
/** Get all used values. */
public function all(): array
{
@ -169,6 +172,28 @@ class SEOManager
return $this->set('image', "https://s.useflipp.com/{$template}.png?s={$signature}&v={$query}");
}
/** Get all extra head tags. */
public function tags(): array
{
return $this->tags;
}
/** Add a head tag. */
public function rawTag(string $tag): static
{
$this->tags[] = $tag;
return $this;
}
/** Add a meta tag. */
public function tag(string $property, string $content): static
{
$this->rawTag("<meta property\"{$property}\" content=\"{$content}\" />");
return $this;
}
/**
* Get or set metadata.
* @param string|array $key The key or key-value pair being set.