/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $list = Todolist::findOrFail($id); $categories = Category::lists('name', 'id')->all(); $selected_categories = $list->categories()->lists('id')->all(); return view('lists.edit')->with(compact('list', 'categories', 'selected_categories')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $categories = Category::lists('name', 'id'); $list = Todolist::find($id); return view('lists.edit')->with('list', $list)->with('categories', $categories); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $categories = Category::lists('name', 'id')->all(); return view('lists.create')->with('categories', $categories); }