No description
Find a file
2025-04-07 13:03:13 +02:00
config feat: 🔖 Add manual implementation to control exposed data and handle translation 2024-09-25 16:28:32 +02:00
routes feat: Change file location to handle k8s restart 2024-09-25 16:54:26 +02:00
src feat: Change file location to handle k8s restart 2024-09-25 16:54:26 +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 feat: 🔖 Add manual implementation to control exposed data and handle translation 2024-09-25 16:28:32 +02:00
composer.json feat: ✨ add Laravel 12 compatibility 2025-04-07 13:03: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 feat: 🔖 Add manual implementation to control exposed data and handle translation 2024-09-25 16:28:32 +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);
}

Change log

Please see the changelog for more information on what has changed recently.

Security

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