1. Go to this page and download the library: Download kfoobar/laravel-seo-tools 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/ */
kfoobar / laravel-seo-tools example snippets
use KFoobar\LaravelSeoTools\Facades\Breadcrumbs;
Breadcrumbs::add('Home', route('home'))
->add('Blog', route('posts.index'))
->add($post->title);
use KFoobar\LaravelSeoTools\Contracts\Sitemapable;
class Post extends Model implements Sitemapable
{
public function toSitemapTag(): string|array
{
return [
'loc' => route('posts.show', $this),
'lastmod' => $this->updated_at,
];
}
}
bash
php artisan vendor:publish --tag=seo-config
bash
php artisan vendor:publish --tag=seo-views
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.