Rubenwouters\CrmLauncher\Controllers\PublishController::replyPost PHP Method

replyPost() public method

Reply post (Facebook)
public replyPost ( Illuminate\Http\Request $request, integer $id ) : view
$request Illuminate\Http\Request
$id integer
return view
    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();
    }