lucacri / laravelsimplesitemap
A Laravel package to create simple sitemaps
3.0.0
2024-04-24 18:08 UTC
Requires
- php: >=8.0
- illuminate/contracts: >=10
- spatie/laravel-package-tools: ^1.13.0
Requires (Dev)
README
A very simple package to create sitemaps from specific URLs
Installation
You can install the package via composer:
composer require lucacri/laravelsimplesitemap
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravelsimplesitemap-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravelsimplesitemap-config"
This is the contents of the published config file:
return [ /* * Storage disk and path where to save the sitemap * */ 'save' => [ 'disk' => 'public', 'path' => 'sitemap.xml' ], /* * The URL where your sitemap will be accessible. * This value will be used to inform Google of the changed sitemap * */ 'sitemap_url' => 'http://example.com/sitemap.xml', /* * An array of URLs to include in the sitemap * Example: * [ 'loc' => 'https://example.com', 'changefreq' => 'weekly', 'priority' => 0.9 ] */ 'urls' => [ // example [ 'loc' => 'https://example.com', 'changefreq' => 'weekly', 'priority' => 0.9 ] ] ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravelsimplesitemap-views"
Usage
php artisan simplesitemap:create --ping-google
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.