lopatin96/laravel-sitemap is a Laravel package for laravel sitemap.
It currently has 0 GitHub stars and 7.640 downloads on Packagist (latest version 1.0.8).
Install it with composer require lopatin96/laravel-sitemap.
Discover more Laravel packages by lopatin96
or browse all Laravel packages to compare alternatives.
Last updated
php artisan vendor:publish --tag="laravel-sitemap-config"
and specify your sitemap settings in config/sitemap.php
Your sitemap.xml file is under http:://127.0.0.1/sitemap.xml`
php artisan vendor:publish --tag="laravel-sitemap-config"
Set custom_pages to true in config/sitemap.php and add a class to your project:
namespace App\Services\SitemapCustomPages;
use App\Models\Item;
class SitemapCustomPages extends \Atin\LaravelSitemap\Services\SitemapCustomPages
{
public function addPages(): void
{
Item::get()->each(function ($item) {
$this->pages->push([
'url' => url("/offers/$item->slug"),
'last_modified' => $item->updated_at,
]);
});
}
}