/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id, DestroyMapRequest $request) { $result = $this->map->destroyMap($id); if ($result == 0) { return redirect()->back()->with('status', 'destroy-error'); } return redirect()->route('admin.map.index')->with('status', 'destroy-success'); }
/** * Display the specified resource. * * @param int $hash * @return \Illuminate\Http\Response */ public function show($hash, Request $request) { $routeName = 'map'; $routeMethod = 'show'; $map = $this->map->getByHash($hash); if (!$map) { $data = compact('routeName', 'routeMethod'); return view('public.sections.map.unavailable', $data); } if ($request->input('redirect') == null) { if (Auth::check()) { return redirect()->route('admin.map.show', $map->id); } } $this->map->countView($map); $environment = collect(['settings' => \Cache::get('settings')]); $data = compact('routeName', 'routeMethod', 'map', 'environment'); \Clockwork::info($map); return view('public.sections.map.show', $data); }