Beispiel #1
0
Route::get('images/{one?}/{two?}/{three?}/{four?}/{five?}', 'SiteComponents\\ImageController@loadImage');
// A few oddities
Route::get('/news/{article}', function ($article) {
    $viewing = NewsArticle::where('slug', $article)->first();
    return View::make('dynamic_pages.article')->with(['title' => $viewing->short_title, 'article' => $viewing]);
});
Route::get('/locations/{location}', function ($location) {
    $viewing = Location::where('name', ucwords(str_replace('-', ' ', $location)))->first();
    return View::make('dynamic_pages.location')->with(['title' => $viewing->name, 'viewingLocation' => $viewing]);
});
Route::get('/galleries/{gallery}', function ($gallery) {
    $viewing = Gallery::where('slug', $gallery)->first();
    return View::make('dynamic_pages.gallery')->with(['title' => $viewing->name, 'gallery' => $viewing]);
});
Route::get('/specials/{special}', function ($special) {
    $viewing = Special::where('title', ucwords(str_replace('-', ' ', $special)))->first();
    return View::make('dynamic_pages.special')->with(['title' => $viewing->title, 'special' => $viewing]);
});
// Some SEO redirects
Route::get('/sales-team', function () {
    return Redirect::to('/locations/' . strtolower(str_replace(' ', '-', Location::current()->name)));
});
Route::any('/careers', function () {
    return Redirect::to('/resources/employment', 301);
});
Route::any('/privacy', function () {
    return Redirect::to('/legal', 301);
});
// This guy is specially generated
Route::get('/sitemap.xml', function () {
    return Sitemap::generate();