ldc-legaulois/config/refresh-sitemap.php
Jérémy Munsch 859b1f3625 Op Insta
2023-04-25 10:10:08 +00:00

143 lines
3.9 KiB
PHP

<?php
use App\Enums\BreedingPageType;
use App\Enums\EleveurOcbStatus;
use App\Models\Articles;
use App\Models\BreedingPage;
use App\Models\ConsumptionTimes;
use App\Models\Label;
use App\Models\MeatTypes;
use App\Models\Products;
use App\Models\Range;
use App\Models\Recipes;
use Spatie\Sitemap\Tags\Url;
return [
'ignoreRoutes' => [
'/login',
'/bo',
'/activer',
'/deconnexion',
'/reinitialiser-mot-de-passe',
'/le-club-des-gaulois/la-boutique',
'/password/confirm',
'/produit/from-menus',
'/la-marque/tracabilite/search',
'/frame',
'/map',
'/_debugbar',
// Hack ignore laravel debug bar.
'/la-marque/actualites/renderActu',
'/le-club-des-gaulois/les-promos/get',
'/{unsubscribe}',
],
'routesBinder' => [
'product.show' => [
'publishedProduct' => [Products::class, 'slug']
],
'products.range' => [
'slugRange' => [Range::class, 'slug'],
'slugSubRange' => [Range::class, 'slug'],
],
'products.consumption-times' => [
'slugConsumptionTime' => [ConsumptionTimes::class, 'slug']
],
'breeding-page.list' => [
'breedingPageType' => [BreedingPageType::class, 'value']
],
'breeding-page.show' => [
'breedingPageType' => [BreedingPageType::class, 'value'],
'breeding_page' => [BreedingPage::class, 'slug']
],
'products.meat-type' => [
'slugMeatType' => [MeatTypes::class, 'slug']
],
'products.label' => [
'slugLabel' => [Label::class, 'slug']
],
'recipes.show' => [
'recipe' => [Recipes::class, 'slug']
],
'club.infos.child' => [
'articleTag' => [Articles::class, 'type'],
'publishedArticle' => [Articles::class, 'slug']
],
'club.indexByCategory' => [
'articleTag' => [Articles::class, 'type']
]
],
/**
* You can put route conditions here
* These will be used to decide whether the route should appear
* in the sitemap or not
*
* These are called in Eloquent where
*
* example
*
* 'queryConditions' => [
* 'status' => true,
* 'ocbStatus' => EleveurOcbStatus::yes()->value,
* 'star_moment' => true
* ]
*
*/
'queryConditions' => [
'status' => true,
'ocbStatus' => strval(EleveurOcbStatus::yes()->value),
'star_moment' => true
],
/**
* The default route frequency to use with sitemap generator
*/
'routeDefaultFrequency' => Url::CHANGE_FREQUENCY_DAILY,
/**
* The default route priority to use with sitemap generator
*
* priority should be a number between 0 and 1
* https://www.sitemaps.org/protocol.html
*/
'routeDefaultPriority' => 0.5,
/**
* Frequencies for routes
* use the full or partial route name as index
* and a frequency within \Spatie\Sitemap\Tags\Url constants
*/
'routeFrequencies' => [
'product-request' => Url::CHANGE_FREQUENCY_WEEKLY
],
/**
* Priorities for routes
* use the full or partial route name as index
* and a priority number between 0 and 1
*/
'routePriorities' => [
'product-request' => 0.6
],
/**
* 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/
* https://laravel.com/docs/8.x/scheduling#schedule-frequency-options
*
* schedule must be set to true
*
* Default is every day at 15:45
*/
'cron' => '45 15 * * *'
];