... | ... | @@ -10,6 +10,9 @@ Route::get('sitemap', function(){ |
|
|
// by default cache is disabled
|
|
|
$sitemap->setCache('laravel.sitemap', 3600);
|
|
|
|
|
|
// check if there is cached sitemap and build new only if is not
|
|
|
if (!$sitemap->isCached())
|
|
|
{
|
|
|
// add item to the sitemap (url, date, priority, freq)
|
|
|
$sitemap->add(URL::to('/'), '2012-08-25T20:10:00+02:00', '1.0', 'daily');
|
|
|
$sitemap->add(URL::to('page'), '2012-08-26T12:30:00+02:00', '0.9', 'monthly');
|
... | ... | @@ -22,6 +25,7 @@ Route::get('sitemap', function(){ |
|
|
{
|
|
|
$sitemap->add($post->slug, $post->modified, $post->priority, $post->freq);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
|
|
|
return $sitemap->render('xml');
|
... | ... | |