PHPackages                             zanysoft/laravel-meta-tags - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zanysoft/laravel-meta-tags

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zanysoft/laravel-meta-tags
==========================

A package to manage Header Meta Tags

1.0.5(3y ago)1475MITPHPPHP ^7.1 || ^8.0CI passing

Since Aug 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zanysoft/laravel-meta-tags)[ Packagist](https://packagist.org/packages/zanysoft/laravel-meta-tags)[ Docs](http://www.zanysoft.net)[ RSS](/packages/zanysoft-laravel-meta-tags/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (6)Used By (0)

Laravel Meta Tags
=================

[](#laravel-meta-tags)

[![Latest Stable Version](https://camo.githubusercontent.com/e5c028dcc12ee2c82ffba41feed4931f5d1a45af121ac918b9752f13c12bce0a/68747470733a2f2f706f7365722e707567782e6f72672f7a616e79736f66742f6c61726176656c2d6d6574612d746167732f762f737461626c652e706e67)](https://packagist.org/packages/zanysoft/laravel-meta-tags) [![Total Downloads](https://camo.githubusercontent.com/97fd59aae0d5d18bc9bd679c14cbfb525ab72d75f559cbdd57f32f795e0fe195/68747470733a2f2f706f7365722e707567782e6f72672f7a616e79736f66742f6c61726176656c2d6d6574612d746167732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/zanysoft/laravel-meta-tags)

With this package you can manage header Meta Tags from Laravel controllers.

---

Installation
------------

[](#installation)

- [Laravel MetaTags on Packagist](https://packagist.org/packages/zanysoft/laravel-meta-tags)
- [Laravel MetaTags on GitHub](https://github.com/zanysoft/laravel-meta-tags)

From the command line run

```
$ composer require zanysoft/laravel-meta-tags

```

Once Meta Tags is installed you need to register the service provider with the application. Open up `config/app.php` and find the `providers` key.

```
'providers' => array(

    ZanySoft\LaravelMetaTags\MetaTagsServiceProvider::class,

)
```

Meta Tags also ships with a facade which provides the static syntax for creating collections. You can register the facade in the `aliases` key of your `config/app.php` file.

```
'aliases' => array(

    'MetaTag'   => ZanySoft\LaravelMetaTags\Facades\MetaTag::class,

)
```

### Publish the configurations

[](#publish-the-configurations)

Run this on the command line from the root of your project:

```
$ php artisan vendor:publish --provider="ZanySoft\LaravelMetaTags\MetaTagsServiceProvider"

```

A configuration file will be publish to `config/meta-tags.php`.

**Trialing slash Configuration**

If you want to add trialing slash to home url then set this to `true` (*if not exist in config file add this*)

```
 'add_trialing_slash' => false,
```

If you want to add query strings to canonical url then set this to `true` (*if not exist in config file add this*)

```
 'canonical_query_string' => false,
```

Twitter Cards and OpenGraph
---------------------------

[](#twitter-cards-and-opengraph)

Various settings for these options can be found in the `config/meta-tags.php` file.

**Twitter Cards**

```
{!! MetaTag::twitterCard() !!}
```

**OpenGraph**

```
{!! MetaTag::openGraph() !!}
```

**For All**

```
{!! MetaTag::renderAll() !!}
```

Examples
--------

[](#examples)

#### app/Http/Controllers/Controller.php

[](#apphttpcontrollerscontrollerphp)

```
