PHP code example of lodeb / laravel-seo

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

    

lodeb / laravel-seo example snippets


return [
    'default_title' => 'My Awesome Website',
    'default_description' => 'This is the best website ever built with Laravel SEO package.',
    'default_keywords' => ['laravel', 'seo', 'package', 'awesome'],
    'default_author' => 'Your Name',
    'default_robots' => 'index, follow',

    'set_canonical_url' => true,
    'set_og_tags' => true,
    'set_twitter_cards' => true,
];

\Lodeb\SEO\Facades\SEO::setTitle($this->meta_title);
\Lodeb\SEO\Facades\SEO::setDescription($this->meta_description);
\Lodeb\SEO\Facades\SEO::setKeywords(explode(',', $this->meta_keywords));
\Lodeb\SEO\Facades\SEO::setAuthor($this->meta_author);
\Lodeb\SEO\Facades\SEO::setRobots($this->meta_robots);

{!! \Lodeb\SEO\Facades\SEO::generate() !!}
bash
php artisan vendor:publish --tag="seo-config"