8000 GitHub - audab/Meta: Small package to generate meta tags easily in your Laravel app
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ Meta Public

Small package to generate meta tags easily in your Laravel app

License

Notifications You must be signed in to change notification settings

audab/Meta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meta

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Small package to generate meta tags easily in your Laravel app

Installation

First, pull in the package through Composer.

"require": {
    "foxted/meta": "1.1.*"
}

Then include the service provider within app/config/app.php.

'providers' => [
    'Foxted\Meta\MetaServiceProvider'
];

Add a facade alias to this same file at the bottom:

'aliases' => [
    'Meta' => 'Foxted\Meta\Facades\Meta'
];

And finally publish the view & config files:

php artisan view:publish foxted/meta
php artisan config:publish foxted/meta

Defaults

Defaults values are set in the config file, to override them, after you ran the php artisan config:publish foxted/meta command, navigate to app/config/packages/foxted/config.php and change the values as you want.

You can also delete them entirely if you do not want any defaults values, just be sure to keep the app/config/packages/foxted/config.php file and return an empty array, like so:

<?php

return [];

Usage

Within your controllers, before rendering your view, generate your tags:

public function index()
{
    Meta::title("My amazing website"); // <title>My amazing website</title>
    Meta::name("keywords", "awesome, keywords"); // <meta name="keywords" content="awesome, keywords">
    Meta::name("description", "The best website you've ever seen"); // <meta name="description" content="The best website you've ever seen">
    Meta::equiv("content-type", "text/html; charset=UTF-8"); // <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    return View::make("index");
}

To show your meta block in your view, just use the following Blade directive:

@meta

Contribution

Any ideas are welcome. Feel free the submit any issues or pull requests.

Enjoy ;)

About

Small package to generate meta tags easily in your Laravel app

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0