/** * Show the form for editing the specified resource. * * @param int $id * @return $this */ public function edit($id) { $cabinet = Cabinet::findOrFail($id); $wires = Wire::all()->lists('reference', 'id'); $strips = Strip::all()->lists('reference', 'id'); $config['center'] = $cabinet->latitude . ', ' . $cabinet->longitude; $config['zoom'] = 15; Gmaps::initialize($config); $marker = []; $marker['position'] = $cabinet->latitude . ', ' . $cabinet->longitude; $marker['draggable'] = true; $marker['ondragend'] = '$("#latitude").val(event.latLng.lat()); $("#longitude").val(event.latLng.lng());'; Gmaps::add_marker($marker); $map = Gmaps::create_map(); return view('admin.cabinets.edit')->with('cabinet', $cabinet)->with('wires', $wires)->with('strips', $strips)->with('map', $map)->with('title', trans('titles.editing_cabinet')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\RedirectResponse * @internal param Request $request */ public function destroy($id) { $strip = Strip::findOrFail($id); $strip->delete(); $message = trans('messages.strip_successfully_removed'); Flash::warning($message); return redirect()->route('admin.strips.index'); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $entity = Strip::findOrFail($id); return view('strips.show')->with('entity', $entity)->with('title', trans('titles.details_of_strip')); }