1. Go to this page and download the library: Download particle-academy/fancy-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/ */
FancySeo::sitemap(function ($map) {
$map->add('/', '1.0', 'daily');
foreach (Package::all() as $pkg) {
$map->add("packages/{$pkg->slug}", '0.8');
}
});
// A provider ADDS to the builder. It must not RETURN its urls -- the return
// value is discarded, and `fn () => ['/', '/about']` used to produce a valid,
// EMPTY sitemap answering 200, which is indistinguishable from a site with
// nothing to list. Since 0.6.0 that throws instead of going quiet. Returning the
// builder is fine: `fn ($map) => $map->add('/')` is the idiomatic chain.
FancySeo::sitemap(fn ($map) => $map->addMany(['/', '/about'])); // many at once
FancySeo::llms(fn (FancySeo $seo) => view('seo.llms')->render());
FancySeo::markdownUsing(fn (string $path) => MarkdownContent::for($path)); // null → 404