/**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @param Request $request
  * @return Response
  */
 public function destroy($id, Request $request)
 {
     $cabinet = Cabinet::findOrFail($request->get('cabinet_id'));
     $cabinet->wires()->detach($id);
     $message = trans('messages.wire_successfully_disassociated');
     Flash::warning($message);
     return redirect()->back();
 }
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     $cabinet = Cabinet::findOrFail($id);
     $config = array();
     $config['center'] = "{$cabinet->latitude}, {$cabinet->longitude}";
     Gmaps::initialize($config);
     $content = '<div id="content"> <div id="siteNotice"> </div>' . '<h1 id="firstHeading" class="firstHeading">' . $cabinet->reference . '</h1>' . '<div id="bodyContent"><p>' . $cabinet->description . '</p>' . '<p><a class="btn btn-primary" target="_blank" href="https://www.google.co.ve/maps/dir/CANTV,+Calle+Boyaca,+San+Fernando+de+Apure/' . $cabinet->latitude . ',' . $cabinet->longitude . '/@7.8900719, -67.4727032,18z">' . trans('buttons.how_to_get') . ' </a></p></div></div>';
     $marker = array();
     $marker['position'] = "{$cabinet->latitude}, {$cabinet->longitude}";
     $marker['infowindow_content'] = $content;
     $marker['animation'] = 'DROP';
     Gmaps::add_marker($marker);
     $map = Gmaps::create_map();
     return view('cabinets.show')->with('cabinet', $cabinet)->with('map', $map)->with('title', trans('titles.details_of_cabinet'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\RedirectResponse
  * @internal param Request $request
  */
 public function destroy($id)
 {
     $cabinet = Cabinet::findOrFail($id);
     $cabinet->delete();
     $message = trans('messages.cabinet_successfully_removed');
     Flash::warning($message);
     return redirect()->route('admin.cabinets.index');
 }