PHPackages                             nik/laravel-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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. nik/laravel-sitemap

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

nik/laravel-sitemap
===================

Laravel Sitemap package for Laravel.

v10.0.0(1mo ago)250MITPHPPHP ^8.2CI passing

Since Jun 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Nikhilchudasama/sitemap)[ Packagist](https://packagist.org/packages/nik/laravel-sitemap)[ RSS](/packages/nik-laravel-sitemap/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (14)Versions (6)Used By (0)

Laravel Sitemap
===============

[](#laravel-sitemap)

[![PHP tests](https://github.com/Nikhilchudasama/sitemap/actions/workflows/workflow.yml/badge.svg)](https://github.com/Nikhilchudasama/sitemap/actions/workflows/workflow.yml)[![Total Downloads](https://camo.githubusercontent.com/1d6717b3c7f51358b791844b5367484f40f79794d769372ab2cff88aa0afe00d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e696b68696c2f6c61726176656c2d736974656d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nikhil/laravel-sitemap)[![License](https://camo.githubusercontent.com/eeaf47d444a6663eab48e5ea2dec9cfaf291da05f71a9ec5ab8dbd77d1ebf133/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e696b68696c2f6c61726176656c2d736974656d61702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nikhil/laravel-sitemap)

A powerful and easy-to-use sitemap generator for Laravel. Support for Google News, Images, Videos, and Multilingual sitemaps.

Features
--------

[](#features)

- Supports Laravel 10, 11, 12, and 13.
- PHP 8.2+ Compatibility.
- Dynamic sitemap generation.
- Automatic caching.
- Support for Big Sitemaps (Sitemap Index).
- Google News, Images, Videos, and Multilingual support.
- Multiple output formats (XML, HTML, TXT).

Requirements
------------

[](#requirements)

- PHP 8.2 or higher.
- Laravel 10, 11, 12, or 13.

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

[](#installation)

Install the package via composer:

```
composer require nikhil/laravel-sitemap
```

(Optional) Publish the configuration file, views, or assets:

```
php artisan vendor:publish --tag="sitemap-config"
php artisan vendor:publish --tag="sitemap-views"
php artisan vendor:publish --tag="sitemap-assets"
```

Quick Start
-----------

[](#quick-start)

Generate a simple sitemap in your `routes/web.php`:

```
use Nikhil\Sitemap\Sitemap;

Route::get('sitemap.xml', function () {
    /** @var Sitemap $sitemap */
    $sitemap = app('sitemap');

    // Add static pages
    $sitemap->add(url('/'), now(), '1.0', 'daily');
    $sitemap->add(url('contact'), now(), '0.7', 'monthly');

    // Add dynamic items from database
    $posts = \App\Models\Post::latest()->get();
    foreach ($posts as $post) {
        $sitemap->add(url($post->slug), $post->updated_at, '0.9', 'weekly');
    }

    return $sitemap->render('xml');
});
```

Advanced Usage
--------------

[](#advanced-usage)

For more detailed examples, please refer to the [EXAMPLES.md](EXAMPLES.md) file.

### Common Scenarios:

[](#common-scenarios)

- **[Caching](EXAMPLES.md#caching)**: Speed up your sitemap generation.
- **[Big Sitemaps](EXAMPLES.md#big-sitemaps-sitemap-index)**: Handling more than 50k items.
- **[Save to File](EXAMPLES.md#generating-sitemap-to-a-file)**: Generate sitemap via Artisan commands.
- **[Images &amp; Videos](EXAMPLES.md#advanced-item-options)**: Add media to your sitemap items.
- **[Multilingual](EXAMPLES.md#translations-multilingual)**: Support for `hreflang` tags.

Development
-----------

[](#development)

Run the package checks locally:

```
composer format:test
composer analyse
composer refactor
composer test
```

To run tests with coverage, enable a coverage driver such as Xdebug or PCOV, then run:

```
composer test-coverage
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance92

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor6

6 contributors hold 50%+ of commits

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

Every ~272 days

Total

5

Last Release

40d ago

Major Versions

1.0 → 9.0.02026-05-13

9.0.1 → v10.0.02026-05-26

PHP version history (2 changes)1.0PHP ^7.3|^8.0|^8.1

9.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/405103d81dcdd44cc6fb006198736b7e7c62ec30e0efcac044434fe2043e6445?d=identicon)[Nikhilchudasama](/maintainers/Nikhilchudasama)

---

Top Contributors

[![Nikhilchudasama](https://avatars.githubusercontent.com/u/20717809?v=4)](https://github.com/Nikhilchudasama "Nikhilchudasama (11 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (6 commits)")[![kiaking](https://avatars.githubusercontent.com/u/3753672?v=4)](https://github.com/kiaking "kiaking (5 commits)")[![Casinelli](https://avatars.githubusercontent.com/u/3205510?v=4)](https://github.com/Casinelli "Casinelli (5 commits)")[![fjborquez](https://avatars.githubusercontent.com/u/39710634?v=4)](https://github.com/fjborquez "fjborquez (4 commits)")[![vs-nikhil-chudasama](https://avatars.githubusercontent.com/u/127194714?v=4)](https://github.com/vs-nikhil-chudasama "vs-nikhil-chudasama (2 commits)")[![atthakorn](https://avatars.githubusercontent.com/u/463654?v=4)](https://github.com/atthakorn "atthakorn (2 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (2 commits)")[![CaraWang](https://avatars.githubusercontent.com/u/4214689?v=4)](https://github.com/CaraWang "CaraWang (2 commits)")[![jaric](https://avatars.githubusercontent.com/u/86606?v=4)](https://github.com/jaric "jaric (2 commits)")[![sarokse](https://avatars.githubusercontent.com/u/109381?v=4)](https://github.com/sarokse "sarokse (2 commits)")[![hpakdaman](https://avatars.githubusercontent.com/u/9606809?v=4)](https://github.com/hpakdaman "hpakdaman (1 commits)")[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (1 commits)")[![seltix5](https://avatars.githubusercontent.com/u/11258096?v=4)](https://github.com/seltix5 "seltix5 (1 commits)")[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (1 commits)")[![escapeboy](https://avatars.githubusercontent.com/u/115266?v=4)](https://github.com/escapeboy "escapeboy (1 commits)")[![dontbug](https://avatars.githubusercontent.com/u/8143119?v=4)](https://github.com/dontbug "dontbug (1 commits)")[![mabasic](https://avatars.githubusercontent.com/u/1839930?v=4)](https://github.com/mabasic "mabasic (1 commits)")[![maciekfreak](https://avatars.githubusercontent.com/u/6990935?v=4)](https://github.com/maciekfreak "maciekfreak (1 commits)")[![MalikinSergey](https://avatars.githubusercontent.com/u/8463996?v=4)](https://github.com/MalikinSergey "MalikinSergey (1 commits)")

---

Tags

phplaravelxmlgeneratorhtmlSitemapgoogle-news

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

37460.0k16](/packages/ultrono-laravel-sitemap)

PHPackages © 2026

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