<?php /** * Created by PhpStorm. * User: Evert * Date: 25/09/2015 * Time: 2:14 */ $localizedRoutes = array(); foreach (\Idw\Audience::all() as $audience) { $localizedRoutes[$audience->route_en] = "doelgroepen/" . $audience->route_nl; foreach (\Idw\Offer::where('audience_id', $audience->id)->get() as $offer) { $localizedRoutes[$audience->route_en . "." . $offer->route_en] = "doelgroepen/" . $audience->route_nl . "/" . $offer->route_nl; } } foreach (\Idw\Post::all() as $post) { $localizedRoutes[$post->route_en] = "nieuws/" . $post->route_nl; } foreach (\Idw\Page::all() as $page) { $localizedRoutes[$page->route_en] = "paginas/" . $page->route_nl; } foreach (\Idw\Event::all() as $event) { $localizedRoutes[$event->route_en] = "evenementen/" . $event->route_nl; } return $localizedRoutes;
/** * Display the specified resource. * * @param string $route * @return Response */ public function showGetAllEvents() { $events = Event::all(); return view('events.index')->with(['events' => $events, 'slug' => 'Evenementen']); }