PHPackages                             tasmir/sitemap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tasmir/sitemap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tasmir/sitemap
==============

A standalone Laravel package for generating dynamic XML sitemaps.

v1.0.0(3mo ago)010↓90.9%MITPHPPHP ^8.0

Since Mar 31Pushed 3mo agoCompare

[ Source](https://github.com/tasmir/sitemap)[ Packagist](https://packagist.org/packages/tasmir/sitemap)[ RSS](/packages/tasmir-sitemap/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Sitemap Generator
=========================

[](#laravel-sitemap-generator)

A powerful, universal, and developer-friendly sitemap generator for Laravel. Automatically index your static routes, map your models, and generate sitemaps with professional features like progress bars and auto-indexing for large sites.

Features
--------

[](#features)

- **🚀 Automated Route Collection**: Automatically discovers and indexes your public, static `GET` routes.
- **✨ Sitemapable Trait**: Give your models the ability to manage their own sitemap metadata.
- **🏢 Sitemap Indexing**: Automatically splits large sitemaps (50k+ URLs) and generates a `sitemap.xml` index.
- **📦 Configuration-Driven**: Easily map models to routes without writing code.
- **🎩 Sitemap Facade**: Simple programmatic access from anywhere in your app.
- **🎨 Blade Templates**: Fully customizable XML output using Blade views.
- **📉 Progress Bars**: Real-time feedback in the terminal during generation.

Installation
------------

[](#installation)

1. Add the package to your `composer.json` or install via composer (if published):

    ```
    composer require tasmir/sitemap
    ```
2. The service provider will be auto-discovered. If not, add it to `config/app.php`:

    ```
    Tasmir\Sitemap\Providers\SitemapServiceProvider::class,
    ```
3. Publish the configuration:

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

Configuration
-------------

[](#configuration)

Edit `config/sitemap.php` to customize the behavior:

### Automated Route Collection

[](#automated-route-collection)

Set `auto_collect_static_routes` to `true` to index all static `GET` routes that don't require parameters and aren't protected by auth.

```
'auto_collect_static_routes' => true,
'exclude_routes' => ['admin.*', 'login', 'register'],
```

### Sitemapable Models

[](#sitemapable-models)

Add models that use the `Tasmir\Sitemap\Traits\Sitemapable` trait here:

```
'sitemapable_models' => [
    \App\Models\Blog::class,
],
```

Usage
-----

[](#usage)

### Using the Trait

[](#using-the-trait)

Add the `Sitemapable` trait to your model and optionally override `getSitemapLoc()`:

```
use Tasmir\Sitemap\Traits\Sitemapable;

class Blog extends Model {
    use Sitemapable;

    public function getSitemapLoc(): string {
        return route('blog.show', $this->slug);
    }
}
```

### Using the Facade

[](#using-the-facade)

You can manually add URLs from anywhere:

```
use Tasmir\Sitemap\Facades\Sitemap;

Sitemap::addUrl(url('/special-page'), now()->toAtomString(), 'weekly', '0.9');
```

Commands
--------

[](#commands)

Generate your sitemap manually:

```
php artisan sitemap:generate
```

The sitemap is generated at `public/sitemap.xml`.

Automation
----------

[](#automation)

The package includes built-in scheduling. You can customize the frequency, time, and timezone in `config/sitemap.php`:

```
'schedule_enabled' => true,
'schedule_timezone' => 'Asia/Dhaka',
'schedule_method' => 'dailyAt',
'schedule_time' => '00:01',
```

Ensure your Laravel scheduler is running in your crontab:

```
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
```

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance82

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67b661104aac762e04093995cba4c76ef5749be1d336d7150d8c4a8e526174bb?d=identicon)[tasmir](/maintainers/tasmir)

---

Top Contributors

[![tasmir](https://avatars.githubusercontent.com/u/25658870?v=4)](https://github.com/tasmir "tasmir (1 commits)")

### Embed Badge

![Health badge](/badges/tasmir-sitemap/health.svg)

```
[![Health](https://phpackages.com/badges/tasmir-sitemap/health.svg)](https://phpackages.com/packages/tasmir-sitemap)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M268](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M993](/packages/illuminate-pagination)[illuminate/redis

The Illuminate Redis package.

8314.4M363](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
