wish-cloud / laravel-sitemap
sitemap generator package for Laravel.
v3.0.0
2025-03-06 03:52 UTC
Requires
- php: ^7.3|^8.0|^8.1|^8.2|^8.3
- illuminate/filesystem: ^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- laravel/framework: ^8.0|^9.0|^10.0|^11.0|^12.0
- orchestra/testbench-core: ^6.0|^7.0|^8.0|^9.0|^10.0
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^8.5|^9.0|^10.0|^11.0
README
forked from Laravelium/laravel-sitemap
Installation
You can install the package via composer:
composer require wish-cloud/laravel-sitemap
Then, publish needed assets (styles, views, config files):
php artisan vendor:publish --provider="WishCloud\LaravelSitemap\SitemapServiceProvider"
Note: Composer won't update them after composer update
, you'll need to do it manually!
Usage
Creating a new sitemap response is easy:
$sitemap = App::make('sitemap'); $sitemap->add('https://example.com/link1', Carbon::now(), '1.0', 'daily'); $sitemap->add('https://example.com/link2', '2022-02-17 13:26:37', '0.8', 'weekly'); return $sitemap->render('xml');
Create index files for large sitemaps:
$sitemap = App::make('sitemap'); $sitemap->addSitemap('https://example.com/sitemap-category.xml'); $sitemap->addSitemap('https://example.com/sitemap-product.xml'); $sitemap->addSitemap('https://example.com/sitemap-article.xml'); return $sitemap->render('sitemapindex');
License
This package is open-sourced software licensed under the MIT license.