PHP code example of puzbie / meta

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);
    }
}



<!DOCTYPE html>
<html lang="en">

<head>

    {!! Meta::dump() !!}

...



                Meta::clear();
                Meta::makeMozStandard(['title'=>'Your Site',
                                       'url'=>'http://www.acesite.co.uk',
                                       'description'=>'My Ace Site  - its the best.',
                                       'image'=>'http://www.acesite.co.uk/images/site.jpg',
                                       'siteName'=>'My Ace Site',
                                       'twitterId'=>'@MyTwitterId',
                                       'creatorId'=>'@MyBlurbWritersTwitterId',
                                       'fbAdmin'=>'12345678901234']);



'Meta' => 'Puzbie\Meta\MetaFacade',