2017 © Pedro Peláez
 

library sitemap

Sitemap generator for Laravel projects

image

wizclumsy/sitemap

Sitemap generator for Laravel projects

  • Friday, March 24, 2017
  • by Wiz Interactive
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Clumsy Sitemap

Simple sitemaps for Laravel projects, (*1)

Latest Stable Version Latest Unstable Version Codacy Badge SensioLabsInsight, (*2)

Installing

Use Composer to install:, (*3)

composer require clumsy/sitemap

In the config/app.php file, add this to the providers key:, (*4)

Wizclumsy\Sitemap\SitemapServiceProvider::class,

Usage

The package automatically creates a route to resolve http://example.com/sitemap.xml. If there are no URLs to insert on your sitemap.xml or an error occurs while parsing them, a 404 error will be thrown on that route., (*5)

In order to add URLs to your sitemap, add a sitemap.php file inside the routes folder of your Laravel app. Inside, return an array with the desired URLs. For example:, (*6)

<?php

return [
    url('/')
];

This will yield the following entry in your sitemap.xml:, (*7)

...
<url>
    <loc>http://workbench.local</loc>
</url>
...

To add tags to the URLs, make the array associative, using the links key as your collection of URLs:, (*8)

<?php

return [
    'changefreq' => 'monthly',
    'priority' => '0.8',
    'lastmod' => '2016-08-04',
    'links' => [
        url('/'),
    ]
];

If you want different URLs to have different values for the supporting tags, use more than one array:, (*9)

<?php

return [
    [
        'changefreq' => 'daily',
        'priority' => '1.0',
        'links' => [
            App\Models\Resource::where('active', true)->get()->pluck('permalink'),
        ],
    ],
    [
        'changefreq' => 'monthly',
        'priority' => '0.8',
        'lastmod' => '2016-08-04',
        'links' => [
            url('/'),
        ],
    ],
];

Customizing

You can optionally edit the path of the sitemap.php file which will contain your URLs and attach middleware to the sitemap route by publishing the default config to your local app:, (*10)

php artisan vendor:publish --provider="Wizclumsy\Sitemap\SitemapServiceProvider" --tag=config

Legacy

For Laravel 4.1 or 4.2 projects, use the 0.1 branch. The 0.3 branch introduced a new default location of the sitemap.php file to be more consistent with the file structure of Laravel 5.3., (*11)

Learn more

Visit sitemaps.org for more info on the protocol., (*12)

The Versions

24/03 2017

dev-master

9999999-dev

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

24/03 2017

0.3.2

0.3.2.0

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

24/03 2017

0.3.1

0.3.1.0

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

26/08 2016

dev-dev

dev-dev

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

26/08 2016

0.3.0

0.3.0.0

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

04/08 2016

0.2.x-dev

0.2.9999999.9999999-dev

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

02/08 2016

0.1.x-dev

0.1.9999999.9999999-dev

Sitemap generator for Laravel 4 projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

02/08 2016

0.1.1

0.1.1.0

Sitemap generator for Laravel 4 projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

24/03 2016

0.2.0

0.2.0.0

Sitemap generator for Laravel projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler

23/03 2016

0.1.0

0.1.0.0

Sitemap generator for Laravel 4 projects

  Sources   Download

MIT

The Requires

 

by Tomas Buteler