Download the PHP package tasmir/sitemap without Composer
On this page you can find all versions of the php package tasmir/sitemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tasmir/sitemap
More information about tasmir/sitemap
Files in tasmir/sitemap
Package sitemap
Short Description A standalone Laravel package for generating dynamic XML sitemaps.
License MIT
Informations about the package sitemap
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
- 🚀 Automated Route Collection: Automatically discovers and indexes your public, static
GETroutes. - ✨ 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.xmlindex. - 📦 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
-
Add the package to your
composer.jsonor install via composer (if published): -
The service provider will be auto-discovered. If not, add it to
config/app.php: - Publish the configuration:
Configuration
Edit config/sitemap.php to customize the behavior:
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.
Sitemapable Models
Add models that use the Tasmir\Sitemap\Traits\Sitemapable trait here:
Usage
Using the Trait
Add the Sitemapable trait to your model and optionally override getSitemapLoc():
Using the Facade
You can manually add URLs from anywhere:
Commands
Generate your sitemap manually:
The sitemap is generated at public/sitemap.xml.
Automation
The package includes built-in scheduling. You can customize the frequency, time, and timezone in config/sitemap.php:
Ensure your Laravel scheduler is running in your crontab:
The MIT License (MIT). Please see License File for more information.