PHPackages                             agpretto/metadata - 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. agpretto/metadata

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

agpretto/metadata
=================

Metadata package for Laravel applications

v0.2.0(6y ago)08MITPHPPHP ^7.1CI failing

Since Sep 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Mindexperiment/metadata)[ Packagist](https://packagist.org/packages/agpretto/metadata)[ Docs](https://github.com/Mindexperiment/metadata)[ RSS](/packages/agpretto-metadata/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Metadata
--------

[](#metadata)

This package provides a way to include metadata tags and other SEO related values inside a view.

This is the most flexible way of inject metadata inside webpages without the need of a database.

> Use this package if you don't need complex implementation over SEO metadata.

### Configuration

[](#configuration)

#### Composer

[](#composer)

Require this package inside your composer.json file

```

"agpretto/metadata": "^0.1"

```

#### Install

[](#install)

Use the package install command to install Metadata inside your application.

```
php artisan metadata:install
// or
php artisan metadata:install --template
```

> Opt-in publishing the default metadata template to your `resouces/views/vendor/metadata` folder.

You can opt-in publishing metadata template by using the flag `-T` or `--template`.

Usage
-----

[](#usage)

This package is a very simple metadata management suite to include metadata tags and related SEO values inside a view.

1. Before start using this package update the configuration file `config/metadata.php` with your default SEO informations.
2. Include a new stack inside your base layout view. This stack will collect all your SEO metadata.

```
// main layout

DOCTYPE html>

        @stack('metadata')

```

Now you're ready to include your metadata.

2. Choose a public view of your website content (ex. views/articles/page.blade.php).

```
@extends('layouts.page')

@section('content')

    {{ $article->title }}

    {{ $article->body }}

@endsection

// push metadata view on the stack
@push('metadata')
    @include('metadata::metadata', [
        'title' => $article->title, //  'John Doe'      //
