/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Request $request, $id) { $reading_id = Comments::where('id', $id)->first(); $redirectId = $reading_id->reading_id; $comment = Comments::findOrFail($id); $comment->comment = $request->comment; $comment->save(); return redirect("currently_reading/{$redirectId}"); }