PHPackages                             sebacarrasco93/laravel-simple-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. sebacarrasco93/laravel-simple-sitemap

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

sebacarrasco93/laravel-simple-sitemap
=====================================

Laravel Simple Sitemap

1.0.2(8mo ago)01.5k[4 PRs](https://github.com/sebacarrasco93/laravel-simple-sitemap/pulls)MITPHPPHP ^8.1CI passing

Since Mar 7Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/sebacarrasco93/laravel-simple-sitemap)[ Packagist](https://packagist.org/packages/sebacarrasco93/laravel-simple-sitemap)[ Docs](https://github.com/sebacarrasco93/laravel-simple-sitemap)[ GitHub Sponsors]()[ RSS](/packages/sebacarrasco93-laravel-simple-sitemap/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (10)Used By (0)

Laravel Simple Sitemap
======================

[](#laravel-simple-sitemap)

A very simple package: Create sitemaps "on the fly"

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

[](#installation)

You can install the package via composer:

```
composer require sebacarrasco93/laravel-simple-sitemap
```

You can publish the config file with:

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

This is the contents of the published config file:

```
return [

    'default_frequency' => 'monthly',

    'default_priority' => '0.50',
];
```

Usage
-----

[](#usage)

Create a sitemap for Eloquent Collections

Let's assume that you want to make a sitemap of all the categories, you can do that in only 3 steps!

```
// app/Models/Category

use SebaCarrasco93\SimpleSitemap\Traits\SimpleSitemapCollection; // 👈 1: Import Trait

class Category extends Model
{
    use HasFactory;
    // ...
    use SimpleSitemapCollection; // 👈 2: Use the trait

    // ...

    // 👇 Step 3: Create getSitemapUrlAttribute() method and specify the full url
    public function getSitemapUrlAttribute(): string
    {
        return route('category.show', $this);
    }
}
```

Now, you can use it

```
// web.php, controller or equivalent

$categories = Category::get();

return SimpleSitemap::fromEloquentCollection($categories);
```

Can I short the syntax? Of course!

```
return Category::sitemap(); // Equivalent to SimpleSitemap::fromEloquentCollection(Category::get());
```

### Advanced usage

[](#advanced-usage)

A sitemap for only active categories? Sure!

```
return Category::where('active', true)
    ->sitemap();
```

A sitemap for active, and only 10 last categories? It's Eloquent and Laravel!

```
$active_categories = Category::where('active', true)
    ->orderBy('desc', 'id')->take(10)->get();

return SimpleSitemap::fromCollection($active_categories);
```

Easy Peasy!

Optionally, you can create a index sitemap with your sitemap collections

```
$routes = [
    route('sitemaps/index-1'), // You can pass it as a route
    'https://yourdomain.com/sitemaps/index-2', // or, as full path
    '/sitemaps/index-3', // as a relative path, too
];

return SimpleSitemap::index($routes);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Seba Carrasco Poblete](https://github.com/sebacarrasco93)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance77

Regular maintenance activity

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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

Every ~178 days

Total

4

Last Release

261d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56bd71b023559779be29a38ac1c178f70c793bc5014ab9748799071e3421ba9a?d=identicon)[sebacarrasco93](/maintainers/sebacarrasco93)

---

Top Contributors

[![sebacarrasco93](https://avatars.githubusercontent.com/u/30738997?v=4)](https://github.com/sebacarrasco93 "sebacarrasco93 (24 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

laravelSeba Carrasco Pobletelaravel-simple-sitemap

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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