megaads / generate-sitemap
This package genernate sitemap.xml file automatically base on databse tables.
Requires
- php: >=5.6.4
- dev-master
- 1.5.21
- 1.5.20
- 1.5.19
- 1.5.18
- 1.5.17
- 1.5.16
- 1.5.15
- 1.5.14
- 1.5.13
- 1.5.12
- 1.5.11
- 1.5.10
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.2
- v1.0.1
- dev-release-master
This package is auto-updated.
Last update: 2024-11-29 02:41:53 UTC
README
This package generate sitemap.xml file automatically base on database table and route
Install and Configuration
Using composer command
composer require megaads/sitemap-generator
After composer install package complete, open file app.php and add below line to providers
:
Megaads\Generatesitemap\GeneratesitemapServiceProvider::class
Then run this command to publish package config to application config folder (NOTE: Add option --force
for overwrite config file. Be sure backup your config file before run with --force
option):
php artisan vendor:publish --provider="Megaads\Generatesitemap\GeneratesitemapServiceProvider"
After run publish command open file generate-sitemap.php
. IF NOT, CAN USING COMMAND TO COPY
cp vendor/megaads/generate-sitemap/config/generate-sitemap.php config/generate-sitemap.php
It see like this:
return [
'multiplesitemap' => false,
'defaultlocale' => '',
'sitemaptype' => [
'categories' => 'category',
'stores' => 'store',
'blogs' => 'blog'
],
'locales' => [
'us' => 'United States',
'uk' => 'United Kingdom',
'ca' => 'Canada',
'fr' => 'France',
'vn' => 'Vietnam',
],
'routes' => [ // Add route name from routes.php for generate sitemap url automatically
'store' => 'frontend::store::listByStore', // Show all stores
'category' => 'frontend::category::listByCategory', // Show all categories
'blog' => 'frontend::blog::detail', // Detail a blog
'coupon' => 'frontend::coupon::detail', // Detail a coupon
'store_n_keyword' => '/'
]
];
Default param multiplesitemap
will be set to false
, mean has single sitemap.xml was generator. If set it to true
sitemap file will be generated to folder with name as key at locales
param config. Create folder name sitemap
in folder public
and
set chmod 775
for this folder for create multiple locales folder.
Add this line to bottom of app\config\app
:
'domain' => 'http://example.com'
Finally, go the below url to generate sitemap. File sitemap.xml will be generate automatically and save to public path.
multiplesitemap
is false
:
If separate sitemap to multiple file using param is_multiple=true
on url when call it. (attension: config sitemaptype
on file config).
//example.com/sitemap-generator
//example.com/sitemap-generator?is_multiple=true
Or multiplesitemap
is true
. This option allow to generate sitemap with multiple language.
//example.com/generator-all-sitemap
Or call to url below for generate all sitemap type (blogs, categories...) group by locales:
//example.com/sitemap/generator-by-locale
And can see result file with url //example.com/sitemap.xml