Download the PHP package puzbie/meta without Composer
On this page you can find all versions of the php package puzbie/meta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package meta
Meta Tag Manager with Laravel 5 Hooks
Installation
Step 1: Composer
Add the package to your composer.json
:
Step 2: Configuration
Add the following to your config/app.php
in the providers
array:
You can also optionally add the following to the aliases
array:
Usage
Basic Suggested Usage:
Use middleware to assign your default meta tags for all pages:
Notice that you can also set the TITLE tag. This is because you may want to duplicate it in certain social tags.
Also notice that the tags have been simplified. The package will expand them to produce the correct tags. For a full list of supported tags see the appendix. But here is an example:
This will expand to:
If your tag of choice isn't supported, then you can build it yourself by supplying a third parameter to setTag,
This will expand to:
Now, in your view template, add the following to the header section:
So far so good. Suppose you want to change the description depending on what page you are on, or add product info tags etc?
Just add them after the middleware and before the dump. You can either add individual tags, or use some of the helper methods
included to generate social tags.
The above example removes the default meta settings, and generates social tags defined in the STANDARD section of this site: https://moz.com/blog/meta-data-templates-123
I'm not affiliated with that site in any way, I just found it a useful source of information.
Notes
- I will be adding more documentation shortly. The tests should give you some pointers though.
- I have removed support for various twitter cards (product, gallery, image etc) as they are being depreciated as of July. You can still add them manually, using settag, should you so desire.
License
MIT
Appendix
Currently Supported Tags:
-