lopatin96/laravel-sitemap 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lopatin96/laravel-sitemap

最新稳定版本:1.0.8

Composer 安装命令:

composer require lopatin96/laravel-sitemap

包简介

Laravel sitemap

README 文档

README

Publish config

php artisan vendor:publish --tag="laravel-sitemap-config"

and specify your sitemap settings in config/sitemap.php

Link to sitemap

Your sitemap.xml file is under http:://127.0.0.1/sitemap.xml`

Publishing

Config

php artisan vendor:publish --tag="laravel-sitemap-config"

Custom pages

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,
            ]);
        });
    }
}

统计信息

  • 总下载量: 7.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-20