1. Go to this page and download the library: Download puzbie/meta library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
puzbie / meta example snippets
namespace App\Http\Middleware;
use Closure;
use Meta;
class MetaDefaults
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
Meta::setTag('charset', 'utf-8');
Meta::setTag('X-UA-Compatible', 'IE=edge');
Meta::setTag('viewport', 'width=device-width, initial-scale=1');
Meta::setTag('author', 'My Name');
Meta::setTag('csrf-token', csrf_token());
Meta::setTitle('My Site - The First Chapter');
Meta::setTag('description', 'If you are at a loss, we have the goss.');
return $next($request);
}
}