diff --git a/assets/views/components/meta.blade.php b/assets/views/components/meta.blade.php
index 3998ea6..cdb618f 100644
--- a/assets/views/components/meta.blade.php
+++ b/assets/views/components/meta.blade.php
@@ -1,9 +1,14 @@
@if(seo('title'))
@seo('title')
-
+
+ @if(seo()->hasTag('og:title'))
+
+ @else
+
+ @endif
@endif
-@if(seo('description'))
+@if(seo('description'))
@endif
diff --git a/composer.json b/composer.json
index df3a55a..02229b5 100644
--- a/composer.json
+++ b/composer.json
@@ -42,5 +42,10 @@
}
},
"minimum-stability": "dev",
- "prefer-stable": true
+ "prefer-stable": true,
+ "config": {
+ "allow-plugins": {
+ "pestphp/pest-plugin": true
+ }
+ }
}
diff --git a/src/SEOManager.php b/src/SEOManager.php
index cbd8fd4..9eb98a3 100644
--- a/src/SEOManager.php
+++ b/src/SEOManager.php
@@ -201,6 +201,18 @@ class SEOManager
return $this->tags;
}
+ /** Has a specific tag been set? */
+ public function hasRawTag(string $key): bool
+ {
+ return array_key_exists($key, $this->tags);
+ }
+
+ /** Has a specific meta tag been set? */
+ public function hasTag(string $property): bool
+ {
+ return $this->hasRawTag("meta.{$property}");
+ }
+
/** Add a head tag. */
public function rawTag(string $key, string $tag = null): static
{
diff --git a/tests/Pest/ManagerTest.php b/tests/Pest/ManagerTest.php
index f404c9b..860cad6 100644
--- a/tests/Pest/ManagerTest.php
+++ b/tests/Pest/ManagerTest.php
@@ -127,3 +127,12 @@ test('canonical url can be changed', function () {
->toContain('')
->toContain('');
});
+
+test('og:title can be overridden as a tag', function () {
+ seo()->title('foo')
+ ->tag('og:title', 'bar');
+
+ expect(meta())
+ ->toContain('foo')
+ ->toContain('');
+});