ldc-cocotte/config/sitemap-generator.php
Jérémy Munsch 0116d220d4
feat(sitemap): implement sitemap generation and configuration
- Added new sitemap generation configuration.
- Removed deprecated refresh-sitemap configuration.
- Updated Product model to implement Sitemapable interface.
- Upgraded sitemap-generator dependency to version 8.1.
2026-11-16 10:35:40 +01:00

100 lines
2.5 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\Product;
use Illuminate\Database\Eloquent\Builder;
return [
/**
* Single route names
*
* Ex:
*
* 'single_pages' => [
* 'homepage',
* ],
*/
'single_pages' => [
'fo.pages.home',
'fo.pages.terms',
'fo.pages.contact',
'fo.pages.privacy',
'fo.pages.faq',
'fo.pages.legal-notice',
'fo.products.index',
],
/**
* Model namespaces with filters
*
* Ex: (model_filters & relation_filters are not necessaries)
* 'cruds' => [
* [
* 'model' => 'App\Models\Product',
* 'model_filters' => [
* ['published', '=', true]
* ],
* 'relation_filters' => [
* 'range' => fn(Builder $q) => $q->where('status', true),
* ],
* 'allow_null_relation' => ['range'],
* ],
* [
* 'model' => 'App\Models\Article',
* ]
* ],
*/
'cruds' => [
[
'model' => Product::class,
'model_filters' => [
['status', '=', true],
],
'relation_filters' => [
'range' => fn (Builder $q) => $q->where('status', true),
],
],
],
/**
* Enable or disable schedule for the job
* If set to true the sitemap generator will be run
* using the 'cron' instruction
*/
'schedule' => true,
/**
* If you want to set specific
* instruction for when to schedule job
* you can set this with a cron instruction
* You can generate one using https://crontab.guru/
*
* schedule must be set to true
*
* Default is every day at 15:45
*/
'cron' => '45 15 * * *',
/**
* All supported locales in the project.
* When used with mcamara/laravel-localization, you can get the values from the package config :
* 'supported_locales' => array_keys(config('laravellocalization.supportedLocales', ['fr' => "Fr"]))
*/
'supported_locales' => ['fr'],
/**
* The location where the sitemap file should be generated.
*/
'output' => [
'storage_disk' => 's3-public',
'path' => 'sitemap.xml',
],
/**
* The route localizer strategy to use.
* Supported: 'default', 'mcamara', or a custom class implementing RouteLocalizerInterface.
*/
'localizer' => 'default',
];