コード例 #1
0
ファイル: ListsController.php プロジェクト: shk33/todo-parrot
 /**
  * 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'));
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 /**
  * 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);
 }