/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($slug) { $post = Post::where('slug', '=', $slug)->firstorFail(); $categories = Category::lists('category', 'id'); return view('admin.post.edit')->with(['post' => $post, 'categories' => $categories]); }