GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kolirt/laravel-sitemap: 🪲 Sitemap generator for Laravel projects

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

Laravel Sitemap

Sitemap generator for Laravel projects

Structure

  • Installation
  • Usage
    • Web routes
    • SitemapController
  • FAQ
  • License
  • Other packages
Buy Me A Coffee

Installation

$ composer require kolirt/laravel-sitemap

Usage

Web routes

Route::get('sitemap.xml', 'SitemapController@index');

SitemapController

class LaravelSitemapController extends Controller
{

    public function index(Request $request)
    {
        $sitemap = new Kolirt\Sitemap\Sitemap;
        $lastMode = Carbon::create(2020, 4, 21, 14, 00, 00);

        $sitemap->setDomain('https://site.com');

        $sitemap->addUrl('', $lastMode, Kolirt\Sitemap\Sitemap::CHANGE_FREG_DAILY, 1);

        $products = [1, 2, 3, 4, 5, 6];
        foreach ($products as $product) {
            $sitemap->addUrl('products/' . $product, $lastMode, Kolirt\Sitemap\Sitemap::CHANGE_FREG_DAILY, 0.8);
        }

        $sitemap->addUrl('page1', $lastMode, Kolirt\Sitemap\Sitemap::CHANGE_FREG_WEEKLY, 0.6);
        $sitemap->addUrl('page2', $lastMode, Sitemap::CHANGE_FREG_MONTHLY, 0.5);

        return $sitemap->render();
    }

}

FAQ

Check closed issues to get answers for most asked questions

License

MIT

Other packages

Check out my other packages on my GitHub profile

About

🪲 Sitemap generator for Laravel projects

Topics

laravellaravel-sitemapsitemap-generatorsitemap-xml

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.