json($comments); } public function getComment(int $commentID): ResponseInterface { $comment = \Comment::find($commentID); $comment->comment = base64_decode($comment->comment); return $this->json($comment); } public function addComment(int $foreignID, string $tablename): ResponseInterface { $commentID = \Comment::addComment($foreignID, $tablename); return $this->json($commentID); } public function saveComment(int $commentID): ResponseInterface { $comment = $this->request->getPost('comment'); $comment = base64_encode($comment); \Comment::whereId($commentID)->update(['comment' => $comment]); return $this->json(['success' => true]); } }