spatie/laravel-sitemap
Generate XML sitemaps for Laravel by crawling your site or building them manually. Add extra URLs, set last-modified dates, and include models via a simple interface. Write sitemaps to disk with a fluent, developer-friendly API.
URLs can have images. See the Google Image Sitemaps documentation for more information.
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;
Sitemap::create()
->add(
Url::create('https://example.com')
->addImage('https://example.com/images/home.jpg', 'Home page image')
)
->writeToFile($sitemapPath);
How can I help you explore Laravel packages today?