Laravel 11 – 13
PHP 8.2+
Low commit activity in last 18 months
A long-lived project that still receives updates
Sitemap generator for Laravel 11, 12 and 13
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

^9.0|^10.0|^11.0
phpunit/phpunit
^11.5.3|^12.5.8

Runtime

^11.0|^12.0|^13.0
^11.0|^12.0|^13.0
 Project Readme

Packagist Version run-tests PHP ^8.2

Laravel Sitemap

This is a Laravel 11, 12 and 13 only fork of Laravelium/laravel-sitemap. The original repository has been abandoned.

The package supports actively supported Laravel releases as per the official Laravel Support Policy.

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

and more in the Wiki.