laravelium/sitemap
Framework-agnostic PHP package for generating XML, TXT, HTML, and Google News sitemaps. Works with Laravel, Symfony, or any PHP project, with support for images, videos, translations, alternates, and Google News. Includes extensible adapters and high test coverage.
alternates and language-specific sitemaps, aligning with i18n roadmaps.lastmod impact on rankings).Sitemap::store() against path traversal in the destination filename — a maintainer-responsiveness signal. Supports a "safe to depend on" decision for a package that writes files into the public web root, and gives security review a concrete artefact rather than an open question.Adopt when:
Sitemap::store() is user-influenced, tenant-supplied, or configurable via admin UI. Earlier versions permit path traversal, meaning a crafted filename could write files outside the intended directory — a real risk for multi-tenant or CMS-admin surfaces.Look elsewhere if:
.xml file.sitemap.xml for Next.js).For Executives: "This package lets us automate sitemap generation for our [Laravel/Symfony] app, cutting SEO maintenance costs by 80% while improving search visibility. It’s battle-tested (1.3K stars, MIT license), supports global audiences via multilingual sitemaps, and future-proofs our content strategy for Google News. The upfront cost? Zero—just a few hours of dev time to integrate. ROI? Higher organic traffic and lower manual work. One note for the risk register: v1.0.4 shipped a path-traversal fix in the file-writing API, so we adopt at v1.0.4 or later and include the package in routine dependency patching — a low, well-understood maintenance line, not a bespoke build."
For Engineering: *"php-sitemap is a lightweight, framework-agnostic solution to replace our ad-hoc sitemap logic. Key benefits:
Sitemap::store filenames — pin ^1.0.4 minimum and treat the filename argument as untrusted input regardless.
Tradeoff: Minimal learning curve (PHP-first), but we’ll need to define sitemap rules (e.g., exclude /admin). Let’s prototype it for our blog and e-commerce sections first."*For SEO/Marketing: *"This tool will:
priority and lastmod tags.xhtml:link alternates for our [languages].For Developers (Technical Deep Dive): *"Key integration points:
config/sitemap.php).Sitemap::add() with Eloquent queries or route callbacks:
Sitemap::add(Route::to('/posts/{id}')->usingModels(Post::class));
FilesystemAdapter (for /public/sitemap.xml) or HttpAdapter (for CDN).lastmod to invalidate on content changes.Sitemap class in PHPUnit with Sitemap::fake().Sitemap::store() now rejects path traversal in the target filename. Bump to ^1.0.4, and still never interpolate user, tenant, or admin-supplied values into the filename — derive it from a fixed allowlist or hash. Audit any existing call sites that pass request data through.
Gotchas: Ensure your robots.txt points to the sitemap, and validate against Google’s guidelines."*How can I help you explore Laravel packages today?