develop-carhelper / laravel-sitemap
Create and generate sitemaps with ease
2.2.5
2017-08-02 08:54 UTC
Requires
- php: ^7.0
- illuminate/support: ~5.3.0|~5.4.0
- nesbot/carbon: ^1.21
- spatie/crawler: ^2.0.2
- spatie/phpunit-snapshot-assertions: ^0.4.1
- spatie/temporary-directory: ^1.1
Requires (Dev)
- orchestra/testbench: ~3.3.0|~3.4.0
- phpunit/phpunit: ^5.7
README
Installation
First, install the package via composer:
composer require develop-carhelper/laravel-sitemap
Next up: installing the service provider
// config/app.php 'providers' => [ ... Carhelper\Sitemap\SitemapServiceProvider::class, ];
Manually creating a sitemap
You can also create a sitemap fully manual:
use Carbon\Carbon; Sitemap::create() ->add('/page1') ->add('/page2') ->add(Url::create('/page3')->setLastModificationDate(Carbon::create('2016', '1', '1'))) ->add(Url::create('/page4')->addXhtmlLink([ 'hreflang' => 'de', 'rel' => 'alternate' 'href' => 'http://www.example.com/deutsch/' ])) ->writeToFile($sitemapPath);
Credits
License
The MIT License (MIT). Please see License File for more information.