/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $data = []; $data['menu'] = Menu::findOrFail($id); $data['menus'] = Menu::findAllWithParent(); $data['contents'] = Content::select('id', 'title')->where('state', 1)->lists('title', 'id')->prepend('Select a content', '')->toArray(); $data['categories'] = Cat::select('id', 'name')->lists('name', 'id')->prepend('Select a category', '')->toArray(); return view('admin.menu.form', $data); }