This repository was archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Laravel and Bard
Mario Basic edited this page Mar 31, 2015
·
8 revisions
<?php namespace App\Http\Controllers;
use Carbon\Carbon;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Laravelista\Bard\UrlSet as Sitemap;
class SitemapController {
protected $sitemap;
public function __construct(Sitemap $sitemap)
{
$this->sitemap = $sitemap;
}
public function generate()
{
$home = $this->sitemap->addUrl(route('home'));
$home->setPriority(0.8);
$home->setChangeFrequency('hourly');
$home->setLastModification(Carbon::now());
$home->addTranslation("de", route('home'));
$this->sitemap->addUrl(route('contact'), 0.7, 'monthly', Carbon::now(), [["hreflang" => 'de', 'href' => route('contact')]]);
$this->sitemap->addUrl(route('gallery'));
return $this->sitemap->render();
}
}
$sitemap = App::make('Laravelista\Bard\Sitemap')
- The cool image with Bard flying and Bard logo are from Bard, the Wandering Caretaker revealed website.