What Laravel Sitemap does
The package generates a sitemap without requiring URLs to be listed manually. Calling SitemapGenerator with a site address crawls the whole site and writes the result to a file path. A second route builds the sitemap by hand, adding Url entries and setting modification dates, which suits sites whose pages are known ahead of time.
Both approaches can be combined: a crawl can be extended with extra entries before the file is written. A closure passed to the write method can also split crawled addresses across separate sitemap files, for instance sending blog pages to one file and the rest to another, so indexing coverage can be tracked per section in Google Search Console.
Key features
- Crawl based generation
- A single generator call takes a site address, crawls every reachable page and writes the resulting sitemap to a chosen path.
- Manual sitemap building
- Sitemap entries can be created directly and given a last modification date through a Carbon instance.
- Combining crawl and manual
- A generated sitemap can be retrieved and extended with additional Url entries before it is written to disk.
- Splitting into multiple files
- A closure passed to writeToFile receives each Url and returns the file path that address belongs in.
- Per section indexing tracking
- Separate sitemap files for blog and other content make indexing coverage easier to follow in Google Search Console.
- Laravel and PHP package
- Distributed as a Composer package for Laravel projects, with usage examples written in PHP.
How it works
- Require the package with Composer inside an existing Laravel project.
- Call SitemapGenerator with the site address to start a crawl.
- Add Url entries manually when some pages should bypass the crawl.
- Optionally pass a closure to sort crawled addresses into separate files.
- Write the result to a file path and serve it as a sitemap.
Plans and pricing
No pricing is printed; the package is published under the MIT licence and installs through Composer.
Integrations and platforms
Works with
- Laravel
- Composer
- Google Search Console
Available as
- Web
Repository facts
- Repositoryspatie/laravel-sitemap
- LanguagePHP
- Stars2620
- Forks293
- LicenceMIT
- Created2016-08-12
- Last commit2026-11-05
- Open issues0
- laravel
- php
- seo
- sitemap
- xml
Services and details
Does SEO work itself
YesFree plan or free tools
YesAPI or MCP server
Yes
No information yet on keyword research, content optimization, writes content with AI, technical audits, rank tracking, backlinks and link building, local SEO, AI search visibility, free trial, WordPress plugin, browser extension, built for agencies. The website did not say; check with the vendor.
About the company
- Company spatie
- Website: github.com/spatie/laravel-sitemap
Listing compiled from public sources and the product's own website. Last updated 2026-11-12. Report a correction or request removal. Back to GitHub repos.