PHP code example of lostcause / laravel-seo-meta

1. Go to this page and download the library: Download lostcause/laravel-seo-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/ */

    

lostcause / laravel-seo-meta example snippets


Schema::create('seo_metas', function (Blueprint $table) {
	$table->increments('id');
	$table->string('model_type');
	$table->integer('model_id')->unsigned();
	$table->text('key');
	$table->text('value');

	$table->timestamps();
});

use AM2Studio\Laravel\SeoMeta\SeoMetaTrait;
use AM2Studio\Laravel\SeoMeta\SeoMetaInterface;

class User implements  SeoMetaInterface
{
    use SeoMetaTrait;

public function seoMetasConfig()
{
	return [
		'title'         => ['generator' => 'example.com - '. $this->title],
		'description'   => ['generator' => 'green-rush.com - '. $this->title . ' - ' . $this->short_description,],
		'keywords'      => ['generator' => 'greenrush, dispensary, ' . $this->title . ', ' . $this->short_description,
		'edit'=> false],
		'og:image'      => ['generator' => ["http://i.stack.imgur.com/hEobN.jpg", "http://i.stack.imgur.com/hEobN2.jpg"]],
		'twitter:site'  => [],
	];
}

public function seoMetas()
{
	return $this->hasMany(SeoMeta::class, 'model_id')->where(['model_type' => __CLASS__]);
}

title						-> string
description					-> string
keywords           			-> string
canonical      				-> string
article:published_time		-> string
article:section				-> string
og:description				-> string
og:title					-> string
og:url               		-> string
og:type             		-> string
og:locale           		-> string
og:locale:alternate			-> array
og:site_name        		-> string
og:image         			-> array
og:image:url       			-> array
og:image:size       		-> string
twitter:card       			-> string
twitter:title      			-> string
twitter:site				-> string

{!! \AM2Studio\Laravel\SeoMeta\SeoMetaHelper::form($dispensary) !!}