- How do I install rumenx/php-sitemap in Laravel?
- Install it with Composer using composer require rumenx/php-sitemap. Laravel package auto-discovery registers the service provider, and you can publish the configuration file with php artisan vendor:publish. No build-system or infrastructure changes are required.
- What sitemap formats does rumenx/php-sitemap generate?
- It generates XML sitemaps, plain-text sitemaps, HTML sitemaps, and Google News sitemaps. It also supports sitemap indexes and URL sets for organizing larger sites. The core is framework-agnostic, with first-party Laravel and Symfony bindings.
- Can I use rumenx/php-sitemap outside Laravel, and which PHP and Laravel versions are supported?
- Yes, the core is framework-agnostic and has first-party Laravel and Symfony bindings, so it works in plain PHP too. For supported PHP and Laravel versions, check composer.json and the CI matrix, and confirm the current tagged release covers your Laravel major before adopting.
- Is rumenx/php-sitemap a good alternative to spatie/laravel-sitemap?
- It is a lighter, framework-agnostic option with XML, TXT, HTML and Google News output, but spatie/laravel-sitemap has a much larger install base and more production validation. If you need a proven ecosystem and community answers, spatie is the safer default. Consider rumenx/php-sitemap when you want a small dependency and are willing to wrap it behind your own interface.
- How do I split large sitemaps into a sitemap index with rumenx/php-sitemap?
- The package supports sitemap indexes and URL sets, so you can group URLs and emit an index that references each child sitemap. Before relying on automatic sharding, verify whether your version enforces the protocol limits of 50,000 URLs and 50 MB uncompressed per file. For a large catalog, add explicit chunking in your own code and test the output.
- Does rumenx/php-sitemap support Google News sitemaps?
- Yes, Google News is one of the supported output formats alongside XML, TXT and HTML. You will still need to supply the required news metadata, such as publication name, language and publication date, from your application data. Check the package documentation for the exact API.
- How do I schedule sitemap generation in Laravel?
- Sitemap generation is a batch job, so run it from Laravel's scheduler or a queued job rather than during request handling. Define a command that calls the generator and writes the sitemap to storage or public disk. Schedule it to run after content changes or at a fixed interval.
- Is rumenx/php-sitemap production-ready and actively maintained?
- The project is a single-maintainer package with a high star count but no public dependent packages, which means limited independent production validation. Review the release tags and commit history, pin a known-good version, and wrap it behind an internal interface so you can swap it out. Treat it as a bounded dependency rather than a platform capability.
- Does rumenx/php-sitemap support gzip, hreflang, and image or video sitemap extensions?
- The documented scope focuses on XML, TXT, HTML and Google News sitemaps, plus sitemap indexes and URL sets. Gzip output, hreflang alternates, and image or video extensions should be verified in the source code and issue tracker before you depend on them. If those features are mandatory, confirm support or plan to extend the generator.
- How should I test sitemap generation in a Laravel app using rumenx/php-sitemap?
- Put the package behind a small adapter or interface, then test your adapter with a fake URL source and assert the generated XML structure. Use Laravel's storage fake to avoid writing real files during tests. Also add an integration test that runs the actual generator against a small fixture and validates the sitemap against the protocol schema.