Ejemplo n.º 1
0
 /**
  * Delete an existing comment.
  *
  * @param int $postId
  * @param int $id
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function destroy($postId, $id)
 {
     $comment = CommentRepository::find($id);
     $this->checkComment($comment);
     $comment->delete();
     return Response::json(['success' => true, 'msg' => 'Comment deleted successfully.', 'comment_id' => $id]);
 }
Ejemplo n.º 2
0
 /**
  * Delete an existing comment.
  *
  * @param int $postId
  * @param int $id
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function destroy($postId, $id)
 {
     $comment = CommentRepository::find($id);
     $this->checkComment($comment);
     $comment->delete();
     return Response::json(['success' => true, 'msg' => trans('messages.comment.delete_success'), 'comment_id' => $id]);
 }