/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Post $postModel, $id, Images $imgModel) { $post = $postModel->getPostInfo($id); $imgs = $imgModel->getAllPostImg($post['id']); $user_id = session('id'); return view('post.edit', ['post' => $post, 'imgs' => $imgs, 'user_id' => $user_id]); }