- How do I install symkit/sitemap-bundle in a Laravel application?
- Install it with composer require symkit/sitemap-bundle. Laravel's package auto-discovery should register the service provider; if your app disables discovery, add the provider manually. Then publish the configuration with php artisan vendor:publish and set your sitemap options.
- Does symkit/sitemap-bundle support automatic route discovery for Laravel routes?
- Yes. The package can automatically discover registered Laravel routes and include them in your sitemap. You can also define custom URL sets and exclude routes you do not want indexed. Check the configuration for route-name, middleware, or model filters.
- Can I generate a sitemap index with multiple sitemap files?
- Yes. It supports sitemap indexes, which let you split a large site across multiple sitemap files and reference them from a single index. This is useful when you exceed search engine limits or want logical grouping by section or locale. Configure your URL sets and index settings in the published config.
- How does caching work and how do I clear the sitemap cache?
- Caching keeps sitemap generation fast by avoiding repeated route discovery and XML building. The exact cache keys and commands are documented by the package; in Laravel you can generally clear application cache with php artisan cache:clear. If the package provides a dedicated clear or generate command, use that in your deployment workflow.
- Does it support multilingual or multi-locale URLs?
- Yes. The package supports multilingual URLs so you can include locale-specific pages and alternate language versions. Configure your supported locales and URL patterns, then generate the sitemap. For best results, keep hreflang annotations consistent with your page markup.
- Which Laravel and PHP versions does symkit/sitemap-bundle support?
- Check the package's composer.json and Packagist metadata for the supported Laravel and PHP version constraints. The Composer name uses bundle, but the package is presented for Laravel applications; confirm framework compatibility in the README before installing. Match the package version to your app's Laravel and PHP versions.
- How do I customize which URLs are included in the sitemap?
- Use customizable URL sets to add pages that are not covered by route discovery. You can define URLs via configuration or closures, include priorities and change frequencies, and exclude unwanted routes. This lets you control exactly which content appears in the XML sitemap.
- Is symkit/sitemap-bundle suitable for production and large sites?
- It is designed for high-performance sitemap generation, with caching and sitemap indexes for large sites. In production, generate sitemaps on a schedule or during deployment and serve the cached XML rather than rebuilding on every request. Monitor generation time and cache invalidation as your route count grows.
- How can I test sitemap generation in my Laravel test suite?
- Write a Laravel feature test that requests your sitemap route and asserts the XML response and expected URLs. If the package exposes testing helpers, use them to fake route discovery or cache. Also test excluded routes, multilingual entries, and sitemap index links.
- What are alternatives to symkit/sitemap-bundle and how actively is it maintained?
- A common alternative is spatie/laravel-sitemap; compare route discovery, caching, indexes, and multilingual support against your needs. For maintenance, review the GitHub repository for recent commits, releases, and open issues. Pin a tested version in composer.json and upgrade deliberately.