public function replyPost(Request $request, $id) { $this->validate($request, ['answer' => 'required']); $publishment = $this->publishment->find($id); if ($request->input('in_reply_to') != "") { $replyTo = $request->input('in_reply_to'); $reply = $this->facebookContent->answerPost($request->input('answer'), $replyTo); $this->insertInnerComment($id, $request, $replyTo, $reply); } else { $replyTo = $publishment->fb_post_id; $reply = $this->facebookContent->answerPost($request->input('answer'), $replyTo); $this->reaction->insertReaction(self::TYPE_FACEBOOK, $reply, $id, $request->input('answer')); } return back(); }