1. Go to this page and download the library: Download philiprehberger/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/ */
philiprehberger / laravel-seo example snippets
use PhilipRehberger\Seo\Facades\Seo;
Seo::setTitle('My Page')
->setDescription('Welcome to my page.')
->setCanonical('https://example.com/page')
->setOgImage('https://example.com/og.jpg')
->setOgType('article')
->setNoindex(false);
use PhilipRehberger\Seo\Facades\Seo;
use PhilipRehberger\Seo\OgType;
Seo::setOgType(OgType::Article);
Seo::setOgType(OgType::Product);
Seo::setOgType(OgType::Video);
// Raw strings are still supported
Seo::setOgType('article');
use PhilipRehberger\Seo\SeoService;
class PageController extends Controller
{
public function show(SeoService $seo): View
{
$seo->setTitle('About Us')
->setDescription('Learn about our team.');
return view('about');
}
}