1. Go to this page and download the library: Download mad-web/laravel-seoable 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/ */
return [
/*
|--------------------------------------------------------------------------
| Seo Data Table
|--------------------------------------------------------------------------
|
| You can customize seo data storing table for your models
*/
'seo_data_table' => 'seo_data',
/*
|--------------------------------------------------------------------------
| Seo Data Templates Path
|--------------------------------------------------------------------------
|
| Path to lang file where you can set property template
|
| Supported properties: "title", "description"
*/
'templates_path' => 'seoable::seo',
/*
|--------------------------------------------------------------------------
| Seo Data Model
|--------------------------------------------------------------------------
|
| Model name for seo data table
*/
'model' => \MadWeb\Seoable\Models\SeoData::class
];
/*
|--------------------------------------------------------------------------
| Seo Data Templates Path
|--------------------------------------------------------------------------
|
| Path to lang file where you can set property template
|
| Supported properties: "title", "description"
*/
'templates_path' => 'seoable::seo',
class User implements Seoable
{
use SeoableTrait;
...
public function seoable()
{
}
}
public function seoable()
{
$this->seo()
->setTitle('full_name')
->setDescription('full_name');
}
return [
\App\User::class => [
'title' => 'This is page title for user profile :full_name',
'description' => 'This is page description for user profile :full_name',
'twitter_card' => [
'title' => 'Page title for twitter card :full_name',
'description' => 'Page description for twitter card :full_name'
],
'open_graph' => [
'title' => 'Page title for open graph :full_name',
'description' => 'Page description for open graph :full_name'
]
]
];
public function seoable()
{
$this->seo()
->setTitleRaw('Some awesome title')
->setDescriptionRaw('Some awesome description');
}
public function seoable()
{
$this->seo()
->setTitle(['name' => 'full_name', 'address' => 'email'])
->setDescription('full_name');
}