/** * Create comment report * * @param User $user * @param Comment $comment * @return mixed */ public function createCommentReport(User $user, Comment $comment) { if ($this->commentReport->findByUserAndComment($user, $comment)) { return false; } $this->stat->increment('reports'); return $this->commentReport->create($user, $comment); }
/** * Report comment * * @param User $user * @param Comment $comment * @return mixed */ public function report(User $user, Comment $comment) { return $this->commentReport->create($user, $comment); }
/** * Close comment report * * @param $commentId * @return \Illuminate\Http\RedirectResponse */ public function closeComment($commentId) { $this->commentReport->deleteByComment($commentId); return redirect()->back(); }