PHPackages                             dvomaks/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. dvomaks/sitemap

ActiveLibrary

dvomaks/sitemap
===============

Simple xml files generator for sitemap

23.3k1PHP

Since Nov 29Pushed 4y ago2 watchersCompare

[ Source](https://github.com/dvomaks/sitemap)[ Packagist](https://packagist.org/packages/dvomaks/sitemap)[ RSS](/packages/dvomaks-sitemap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Generate sitemaps with ease
===========================

[](#generate-sitemaps-with-ease)

You can create your sitemap manually:

```
use Carbon\Carbon;
use Dvomaks\Sitemap\Sitemap;
use Dvomaks\Sitemap\Tags\Url;

Sitemap::create()

    ->add(Url::create('/home')
        ->setLastModificationDate(Carbon::yesterday())
        ->setChangeFrequency(Url::CHANGE_FREQUENCY_YEARLY)
        ->setPriority(0.1))

   ->add(...)

   ->writeToFile($path);
```

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

[](#installation)

First, install the package via composer:

```
composer require dvomaks/sitemap
```

The package will automatically register itself.

Usage
-----

[](#usage)

### Manually creating a sitemap

[](#manually-creating-a-sitemap)

You can also create a sitemap fully manual:

```
use Carbon\Carbon;

Sitemap::create()
   ->add('/page1')
   ->add('/page2')
   ->add(Url::create('/page3')->setLastModificationDate(Carbon::create('2016', '1', '1')))
   ->writeToFile($sitemapPath);
```

### Creating a sitemap index

[](#creating-a-sitemap-index)

You can create a sitemap index:

```
use Dvomaks\Sitemap\SitemapIndex;

SitemapIndex::create()
    ->add('/pages_sitemap.xml')
    ->add('/posts_sitemap.xml')
    ->writeToFile($sitemapIndexPath);
```

You can pass a `Dvomaks\Sitemap\Tags\Sitemap` object to manually set the `lastModificationDate` property.

```
use Dvomaks\Sitemap\SitemapIndex;
use Dvomaks\Sitemap\Tags\Sitemap;

SitemapIndex::create()
    ->add('/pages_sitemap.xml')
    ->add(Sitemap::create('/posts_sitemap.xml')
        ->setLastModificationDate(Carbon::yesterday()))
    ->writeToFile($sitemapIndexPath);
```

the generated sitemap index will look similar to this:

```

      http://www.example.com/pages_sitemap.xml
      2016-01-01T00:00:00+00:00

      http://www.example.com/posts_sitemap.xml
      2015-12-31T00:00:00+00:00

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity27

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4de953ca506a84e7c5f03d4dccb89fb18e05dac1a90d26ede34e6262ae4ed67c?d=identicon)[dvomaks](/maintainers/dvomaks)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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