<?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;
public function restore(Request $request) { Event::withTrashed()->where('id', $request->id)->restore(); $event = Event::find($request->id); $message = "<div class='alert alert-success' role='alert'>\n <span class='fa fa-fw fa-thumbs-o-up'></span> <strong>" . ucfirst($event->name_nl) . "</strong> werd met succes terug toegevoegd aan het aanbod van!\n </div>"; Session::flash('messages', $message); return redirect('/admin/dashboard/events'); }