/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $article = Article::find($id); $categories = Category::orderBy('name', 'id')->lists('name', 'id'); $tags = Tag::orderBy('name', 'id')->lists('name', 'id'); $my_tags = $article->tags->lists('id')->ToArray(); return view("article.edit", ["article" => $article, 'categories' => $categories, 'tags' => $tags, 'my_tags' => $my_tags]); }