Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
This is an archived project. Repository and other project resources are read-only.
Laravelium
Sitemap
Wiki
Dynamic sitemap
Dynamic sitemap
· Changes
Page history
Updated Dynamic sitemap (markdown)
authored
Dec 10, 2015
by
Roumen Damianoff
Hide whitespace changes
Inline
Side-by-side
Dynamic-sitemap.md
View page @
0aa8d548
...
@@ -6,9 +6,9 @@ Route::get('sitemap', function(){
...
@@ -6,9 +6,9 @@ Route::get('sitemap', function(){
// create new sitemap object
// create new sitemap object
$sitemap
=
App
::
make
(
"sitemap"
);
$sitemap
=
App
::
make
(
"sitemap"
);
// set cache
(
key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean)
)
// set cache key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean)
// by default cache is disabled
// by default cache is disabled
$sitemap
->
setCache
(
'laravel.sitemap'
,
360
0
);
$sitemap
->
setCache
(
'laravel.sitemap'
,
6
0
);
// check if there is cached sitemap and build new only if is not
// check if there is cached sitemap and build new only if is not
if
(
!
$sitemap
->
isCached
())
if
(
!
$sitemap
->
isCached
())
...
...