1. Go to this page and download the library: Download tasmir/sitemap 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/ */
use Tasmir\Sitemap\Traits\Sitemapable;
class Blog extends Model {
use Sitemapable;
public function getSitemapLoc(): string {
return route('blog.show', $this->slug);
}
}
use Tasmir\Sitemap\Facades\Sitemap;
Sitemap::addUrl(url('/special-page'), now()->toAtomString(), 'weekly', '0.9');