Releases: butschster/LaravelMetaTags
Releases · butschster/LaravelMetaTags
v1.12
Added
- Added ability to add visibility condition for tag entities. #29
Tag::meta([
'name' => 'description',
'content' => 'Another cool description'
])->visibleWhen(function () {
return Request::ip() === '127.0.0.1';
});- Added ability to use anonymous functions as tag attribute value #28
new Tag('meta', [
'name' => 'csrf-token',
'content' => function () {
return Session::token();
}
])Fixed
1.9: Merge pull request #25 from spacemudd/l8-compatibility
Add Laravel 8 support
v1.8: Merge pull request #23 from jwcobb/improve-twitter-cards
Improvements to Twitter Cards
Removed closing tags
Merge pull request #21 from Hladenkyi/master Removed closing tags
Fixed problem with wrong og meta tags
Fixed issue #17
v1.6.7
fix
Removed deprecated trait Illuminate\Console\DetectsApplicationNamespace
Added support for Laravel 7.*
Merge pull request #13 from nguyentranchung/patch-1 Support laravel 7.x
Separate Google analytics into Analytics and Tag manager
Google Analytics
Has header placement!
use Butschster\Head\MetaTags\Entities\GoogleAnalytics;
$script = new GoogleAnalytics('UA-12345678-1');
Meta::addTag('google.analytics', $script);Will return
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-12345678-1', 'auto');
ga('send', 'pageview');
</script>Google TagManager
Has header placement!
use Butschster\Head\MetaTags\Entities\GoogleTagManager;
$script = new GoogleTagManager('UA-12345678-1');
Meta::addTag('google.tagmanager', $script);Will return
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-12345678-1');
</script>Google Analytics tag
Google Analytics
Has header placement!
use Butschster\Head\MetaTags\Entities\GoogleAnalytics;
$script = new GoogleAnalytics('UA-12345678-1');
Meta::addTag('google.analytics', $script);Will return
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-12345678-1');
</script>