No description
Find a file
Karl M'muller 1f789eca23 Merge branch 'fix-error' into 'develop'
chore: 🔖 release v7.1.1

See merge request ldc-web/projets/sitemap-generator!7
2026-08-24 11:18:26 +00:00
config feat: ✨ Added the possibility to get models with nullable relations 2026-06-23 11:54:47 +02:00
routes feat: Change file location to handle k8s restart 2024-09-25 16:54:26 +02:00
src fix: 🐛 improve error catch for the generate command 2026-08-24 11:51:25 +02:00
.editorconfig First workin version without headleass chrome config 2023-08-10 14:48:45 +02:00
.gitignore First workin version without headleass chrome config 2023-08-10 14:48:45 +02:00
.gitlab-ci.yml Add gitlab CI file 2023-08-11 11:31:55 +02:00
.styleci.yml First workin version without headleass chrome config 2023-08-10 14:48:45 +02:00
CHANGELOG.md chore: 🔖 release v7.1.1 2026-08-24 11:52:05 +02:00
composer.json chore: 🔖 release v7.1.1 2026-08-24 11:52:05 +02:00
composer.lock feat: ✨ Added laravel 13 compatibility 2026-04-16 11:24:02 +02:00
phpcs.xml feat: ✨ Added laravel 13 compatibility 2026-04-16 11:24:02 +02:00
README.md chore: 🔖 release v7.1.1 2026-08-24 11:52:05 +02:00

Refresh Sitemap

Creates sitemap.xml and refresh using a config file

Handle i18n routes with codezero/laravel-localized-routes packages.

Installation

Via Composer

composer require uwil/sitemap-generator

Usage

  1. php artisan vendor:publish --tag=sitemap-generator

  2. Change configuration in config/sitemap-generator.php

  3. You can test your configuration using php artisan sitemap:refresh --dry-run

Model implementation

Add :

use Spatie\Sitemap\Contracts\Sitemapable;
use Spatie\Sitemap\Tags\Url;
use Uwil\SitemapGenerator\Lib\SitemapHelper;

Model must implement :

implements Sitemapable

And an toSitemapTag method ex :

/**
 * toSitemapTag method
 *
 * @return Url|string|array
 */
public function toSitemapTag(): Url | string | array
{
    $model  = $this->loadMissing('range');
    $route  = 'product.show';
    $params = ['range' => $model->range, 'publishedProduct' => $model];
    return SitemapHelper::generateUrl($route, $params, $model);
}

Security

If you discover any security related issues, please email equipe.web@ldc.fr instead of using the issue tracker.

Changelog

Latest version v7.1.1.

See the CHANGELOG.md file for details.

Copyright and License

Sitemap Generator was written by Uwil.

Copyright (c) 2023 and beyond Uwil.