No description
Find a file
2025-07-18 15:30:41 +02:00
config feat: ✨ add filters on model relations 2025-07-18 15:30:41 +02:00
routes feat: Change file location to handle k8s restart 2024-09-25 16:54:26 +02:00
src feat: ✨ add filters on model relations 2025-07-18 15:30:41 +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 v4.0.0 2025-04-07 13:10:13 +02:00
composer.json chore: 🔖 release v4.0.0 2025-04-07 13:10:13 +02:00
composer.lock feat: 🔖 Add manual implementation to control exposed data and handle translation 2024-09-25 16:28:32 +02:00
phpcs.xml First workin version without headleass chrome config 2023-08-10 14:48:45 +02:00
README.md chore: 🔖 release v4.0.0 2025-04-07 13:10:13 +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 v4.0.0.

See the CHANGELOG.md file for details.

Copyright and License

Sitemap Generator was written by Uwil.

Copyright (c) 2023 and beyond Uwil.