Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eusonlito/laravel-meta

HTML Meta Tags management package available for for Laravel >= 5 (Including 10)
https://github.com/eusonlito/laravel-meta

html laravel meta php tags

Last synced: 6 days ago
JSON representation

HTML Meta Tags management package available for for Laravel >= 5 (Including 10)

Awesome Lists containing this project

README

        

# HTML Meta Tags management package available for Laravel >= 5 (Including 10)

[![Build Status](https://travis-ci.org/eusonlito/laravel-Meta.svg?branch=master)](https://travis-ci.org/eusonlito/laravel-Meta)
[![Latest Stable Version](https://poser.pugx.org/eusonlito/laravel-meta/v/stable.png)](https://packagist.org/packages/eusonlito/laravel-meta)
[![Total Downloads](https://poser.pugx.org/eusonlito/laravel-meta/downloads.png)](https://packagist.org/packages/eusonlito/laravel-meta)
[![License](https://poser.pugx.org/eusonlito/laravel-meta/license.png)](https://packagist.org/packages/eusonlito/laravel-meta)

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

If you want a Laravel <= 4.2 compatible version, please use `v4.2` branch.

## Installation

Begin by installing this package through Composer.

```js
{
"require": {
"eusonlito/laravel-meta": "3.1.*"
}
}
```

### Laravel installation

```php

// config/app.php

'providers' => [
'...',
Eusonlito\LaravelMeta\MetaServiceProvider::class
];

'aliases' => [
'...',
'Meta' => Eusonlito\LaravelMeta\Facade::class,
];
```

Now you have a ```Meta``` facade available.

Publish the config file:

```
php artisan vendor:publish --provider="Eusonlito\LaravelMeta\MetaServiceProvider"
```

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

```php




{!! Meta::get('title') !!}

{!! Meta::tag('robots') !!}

{!! Meta::tag('site_name', 'My site') !!}
{!! Meta::tag('url', Request::url()); !!}
{!! Meta::tag('locale', 'en_EN') !!}

{!! Meta::tag('title') !!}
{!! Meta::tag('description') !!}

{!! Meta::tag('canonical') !!}

{{-- Print custom section images and a default image after that --}}
{!! Meta::tag('image', asset('images/default-logo.png')) !!}


...

...