digit7s/laravel-seo-sitemap

Reusable Laravel SEO sitemap abstraction for Laravel applications.

Maintainers

Package info

github.com/Digit7s/laravel-seo-sitemap

Homepage

Issues

pkg:composer/digit7s/laravel-seo-sitemap

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.0 2026-08-28 15:46 UTC

This package is auto-updated.

Last update: 2026-08-28 15:48:59 UTC


README

Latest Version on Packagist Total Downloads PHP Version Tests License

digit7s/laravel-seo-sitemap is a reusable Laravel package for SEO sitemap generation across Laravel applications.

The package uses spatie/laravel-sitemap as the underlying sitemap engine and provides an application-focused abstraction layer that can grow without coupling consuming applications to Filament, Inertia, Vue, project-specific Eloquent models, route names, locale models, or database schemas.

Requirements

  • PHP 8.4 or higher
  • Laravel 12 or 13

Installation

composer require digit7s/laravel-seo-sitemap

Publish the configuration when you need to customize the package defaults:

php artisan vendor:publish --tag=seo-sitemap-config

Quick Start

  1. Implement an application sitemap definition:
namespace App\Sitemap;

use Digit7s\SeoSitemap\Contracts\SitemapDefinition;
use Digit7s\SeoSitemap\Sitemap\SitemapBuilder;
use Digit7s\SeoSitemap\Sitemap\SitemapManager;

final class WebsiteSitemap implements SitemapDefinition
{
    public function build(SitemapManager $manager): SitemapBuilder
    {
        return $manager
            ->createBuilder()
            ->addUrl('/')
            ->addUrl('about')
            ->addRoute('contact');
    }
}
  1. Bind SitemapDefinition in your AppServiceProvider:
use App\Sitemap\WebsiteSitemap;
use Digit7s\SeoSitemap\Contracts\SitemapDefinition;

public function register(): void
{
    $this->app->bind(SitemapDefinition::class, WebsiteSitemap::class);
}
  1. Generate the sitemap:
php artisan sitemap:generate
  1. (Optional) Schedule generation in routes/console.php:
use Illuminate\Support\Facades\Schedule;

Schedule::command('sitemap:generate')
    ->daily()
    ->withoutOverlapping();

Documentation

Testing

composer validate --strict
composer test
composer analyse
composer format

License

The MIT License. See LICENSE.md.