From d2f58ea87ce1a67d3e6439814b2a8119830215e4 Mon Sep 17 00:00:00 2001 From: Robin C Samuel Date: Wed, 25 May 2016 18:47:00 +0530 Subject: [PATCH 1/2] Meta tag description not working Default value was not working. I set description from controller and that worked for og:description, but the meta tag description content was empty for {!! Meta::tag('description'); !!}. --- src/Torann/LaravelMetaTags/MetaTag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Torann/LaravelMetaTags/MetaTag.php b/src/Torann/LaravelMetaTags/MetaTag.php index 84f4d50..d346c9e 100644 --- a/src/Torann/LaravelMetaTags/MetaTag.php +++ b/src/Torann/LaravelMetaTags/MetaTag.php @@ -127,7 +127,7 @@ public function tag($key, $value = '') { return $this->createTag([ 'name' => $key, - 'content' => $value + 'content' => $value?:$this->metas[$key] ]); } From 21c4251ed2d21e3cc207f88d093cdea79883ba77 Mon Sep 17 00:00:00 2001 From: Robin C Samuel Date: Thu, 30 Jun 2016 20:05:44 +0530 Subject: [PATCH 2/2] Update MetaTag.php --- src/Torann/LaravelMetaTags/MetaTag.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Torann/LaravelMetaTags/MetaTag.php b/src/Torann/LaravelMetaTags/MetaTag.php index d346c9e..0a53fd7 100644 --- a/src/Torann/LaravelMetaTags/MetaTag.php +++ b/src/Torann/LaravelMetaTags/MetaTag.php @@ -3,6 +3,7 @@ namespace Torann\LaravelMetaTags; use Illuminate\Http\Request; +use Illuminate\Support\Arr; class MetaTag { @@ -127,7 +128,7 @@ public function tag($key, $value = '') { return $this->createTag([ 'name' => $key, - 'content' => $value?:$this->metas[$key] + 'content' => $value ?: Arr::get($this->metas, $key, '') ]); }