ultrono / laravel-sitemap
PHP 8 sitemap generator for Laravel 8, 9, 10 and 11
Installs: 135 974
Dependents: 1
Suggesters: 0
Security: 0
Stars: 35
Watchers: 0
Forks: 275
Open Issues: 0
Requires
- php: ^8.0
- illuminate/filesystem: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^6.23|^7.0|^8.0|^9.0
- phpunit/phpunit: ^9.4|^10.1
- dev-master
- 9.4.0
- 9.3.0
- 9.2.0
- 9.1.0
- 9.0.2
- 9.0.1
- 9.0.0
- 8.0.1
- v7.0.1
- v6.0.1
- v3.1.1
- v3.0.1
- v2.8.3
- v2.8.2
- v2.8.1
- v2.7.3
- v2.7.2
- v2.6.5
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.5.8
- v2.5.6
- v2.5.5
- v2.5.3
- v2.5.2
- v2.4.20
- v2.4.19
- v2.4.16
- v2.4.15
- v2.4.11
- dev-ultrono-patch-4
- dev-ultrono-patch-3
- dev-ultrono-patch-2
- dev-ultrono-patch-1
This package is auto-updated.
Last update: 2024-12-23 10:28:59 UTC
README
Laravel Sitemap
This is a Laravel 8, 9, 10 and 11 only fork of Laravelium/laravel-sitemap. The original repository has been abandoned.
PHP ^8.0
is required.
Installation
If laravelium/sitemap
is already part of the project:
composer remove laravelium/sitemap
Then run:
composer require ultrono/laravel-sitemap
php artisan vendor:publish --provider="Ultrono\Sitemap\SitemapServiceProvider"
Generate a simple sitemap
Route::get('mysitemap', function() { $sitemap = resolve("sitemap"); $sitemap->add(URL::to(), '2012-08-25T20:10:00+02:00', '1.0', 'daily'); $sitemap->add(URL::to('page'), '2012-08-26T12:30:00+02:00', '0.9', 'monthly'); $posts = DB::table('posts')->orderBy('created_at', 'desc')->get(); foreach ($posts as $post) { $sitemap->add($post->slug, $post->modified, $post->priority, $post->freq); } // generate (format, filename) // sitemap.xml is stored within the public folder $sitemap->store('xml', 'sitemap'); });
Examples
- How to generate dynamic sitemap (with optional caching)
- How to generate BIG sitemaps (with more than 1M items)
- How to generate sitemap to a file
- How to use multiple sitemaps with sitemap index
and more in the Wiki.