ldc-sitemap-generator/CHANGELOG.md

6.8 KiB

Changelog

All notable changes to sitemap-generator will be documented in this file.

[v8.1.0] - 15/10/2026

Added

  • GenerateSitemapJob queueable job (ShouldQueue) for asynchronous and background sitemap generation.
  • --queue option on uwil:sitemap:refresh artisan command to dispatch generation to the queue.

Fixed

  • Fixed scheduler crash on staging (Target class [uwil:sitemap:refresh] does not exist) in SitemapGeneratorServiceProvider by scheduling new GenerateSitemapJob() instead of command signature string.

[v8.0.0] - 14/10/2026

Added

  • Unit and integration test suites powered by Pest PHP (pestphp/pest: ^5.3) with full GWT structure.
  • Static analysis with Larastan (larastan/larastan: ^3.0) at level 10 and code formatting with Laravel Pint.
  • Configurable output disk and path via output.storage_disk and output.path in config/sitemap-generator.php (backed by Laravel Storage / Flysystem).
  • Contract-based route localization (RouteLocalizerInterface) allowing custom or default implementations.
  • Configurable localizer strategy via localizer in config/sitemap-generator.php (supports 'default', 'mcamara', or custom class).
  • Model localization support via Uwil\SitemapGenerator\Contracts\Sitemapable with automated alternate tag resolution.
  • Exhaustive test coverage for CRUD queries supporting model filters, relation filters (closures, arrays, string booleans), and allow_null_relation.
  • Fail-fast migration guards with actionable error messages for deprecated config keys (singlePages, output_path, relationFilters, modelFilters, allowNullRelation).

Changed

  • Breaking: Required PHP version bumped to ^8.5 and Laravel/Illuminate to ^13.0.
  • Breaking: Replaced output_path with output (storage_disk and path) to support any Flysystem disk (local, public, S3, etc.).
  • Breaking: Renamed config key singlePages to single_pages (snake_case).
  • Breaking: Standardized CRUD configuration keys to snake_case (relation_filters, model_filters, allow_null_relation).
  • Decoupled mcamara/laravel-localization: it is now an optional suggest/dev dependency. DefaultRouteLocalizer is used as fallback when absent.
  • Deep internal architecture refactor:
    • Extracted generation logic out of GenerateSitemapCommand into dedicated SitemapGenerator and SitemapConfig classes.
    • Introduced SitemapStorage encapsulation for disk interactions (reading, writing, streaming, path normalization).
    • Refactored SitemapHelper from a static helper into a container-bound dependency.
    • Moved Sitemapable contract under namespace Uwil\SitemapGenerator\Contracts\Sitemapable.
    • Enforced strict types (declare(strict_types=1);) across the entire codebase.
  • Dynamically served sitemap in GET /sitemap.xml as a stream directly from the configured storage disk.

Fixed

  • Fixed --dry-run console option detection in uwil:sitemap:refresh.
  • Fixed Mcamara route localizer to return null instead of falling back to bare locale root (/fr) when route translations are missing.
  • Improved relation filter support in CRUD queries to safely support Closures, arrays, and boolean strings.
  • Fixed CRUD list parsing in SitemapConfig to reliably support list-based arrays.

Migrate to 8.0.0

  1. Config file update: Update your config/sitemap-generator.php with the new keys:

    // Before (v7)
    'singlePages' => ['homepage'],
    'output_path' => storage_path('app/public/sitemap.xml'),
    'cruds' => [
        [
            'model'              => App\Models\Product::class,
            'relationFilters'    => [...],
            'modelFilters'       => [...],
            'allowNullRelations' => [...],
        ],
    ],
    
    // After (v8)
    'single_pages' => ['homepage'],
    'output' => [
        'storage_disk' => 'public',
        'path'         => 'sitemap.xml',
    ],
    'cruds' => [
        [
            'model'               => App\Models\Product::class,
            'relation_filters'    => [...],
            'model_filters'       => [...],
            'allow_null_relation' => [...],
        ],
    ],
    
  2. Model contract namespace update: Update imports on your models implementing the sitemap contract:

    // Before
    use Uwil\SitemapGenerator\Interfaces\Sitemapable;
    
    // After
    use Uwil\SitemapGenerator\Contracts\Sitemapable;
    
  3. Optional Dependency: If you rely on localized route translations via mcamara/laravel-localization, make sure to require it explicitly in your application's composer.json, as it is no longer bundled by default.

[v7.1.1] - 24/08/2026

  • Improve error catch in uwil:sitemap:refresh command.

[v7.1.0] - 23/06/2026

  • Added the possibility to get models with nullable relations.

New parameter in config:

'cruds' => [
    [
        'model' => 'App\Models\Product',
        'model_filters' => [
            ['published', '=', true],
        ],
        'relation_filters' => [
            'range' => fn(Builder $q) => $q->where('status', true),
        ],
        'allow_null_relation' => ['range'], // New parameter
    ],
    [
        'model' => 'App\Models\Article',
    ],
],

[v7.0.0] - 17/04/2026

  • Laravel 13 Compatibility.

[v6.0.0] - 31/03/2026

Added

  • Re-think the locale system to match new Google expectations.
  • Added news sitemap support.

Migrate to 6.0.0

  • Locales are now in sitemap-generator.php (supported_locales).
  • Models must implement Uwil\SitemapGenerator\Contracts\Sitemapable with getLocalizedUrl(string $locale): string.

[v5.0.1] - 18/07/2025

Fixed

  • Change model filters key in command.

[v5.0.0] - 18/07/2025

Added

  • Add filters on model relations.

[v4.0.0] - 07/04/2025

Added

  • Laravel 12 compatibility.

[v3.0.0] - 25/09/2024

Added

  • Add manual implementation to control exposed data and handle translation.
  • Change file location to handle Kubernetes restarts.

[v2.0.1] - 12/02/2024

Changed

  • Kubernetes convenience output file option.

[v2.0.0] - 11/11/2023

Added

  • Add manual implementation to control exposed data and manage translation.

[v1.0.3] - 11/08/2023

Fixed

  • Sitemap output was the original, not the filtered one.

[v1.0.2] - 11/08/2023

Fixed

  • Ignore URLs with queries (only RESTful URLs handled).
  • Reduce dry-run output to fit console.
  • Handle non-HTML URLs for which routes cannot be resolved.

[v1.0.1] - 11/08/2023

Fixed

  • Install sitemap command.

[v1.0.0] - 11/08/2023

Added

  • Initial release.