/** * Display a listing of the resource. * * @return Response */ public function index() { $articulos = Articulos::where('submenu_id', Input::get('submenu_id'))->get(); if (SubMenu::find(Input::get('submenu_id'))) { $submenu = SubMenu::find(Input::get('submenu_id')); return view('articulos.reporte', compact('articulos', 'submenu')); } //Hay que cambiar por error desde HTML dd('No hay SubMenu'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $subMenu = SubMenu::find($id); $menu_id = $subMenu->menu_id; $subMenu->delete(); return redirect()->route('submenus.index', ['menus_id' => $menu_id]); }