コード例 #1
0
 /**
  * Report comment
  *
  * @param $comment
  * @return mixed
  */
 public function report($comment)
 {
     $comment = $this->comment->findById($comment, $this->currentUser);
     if (!$comment) {
         throw new NotFoundHttpException();
     }
     $this->report->createCommentReport($this->currentUser, $comment);
     return [];
 }
コード例 #2
0
 /**
  * Create post report
  *
  * @param Post $post
  * @param Request $request
  */
 public function report(Post $post, Request $request)
 {
     $this->validate($request, ['reason' => 'required']);
     $this->report->createPostReport($this->currentUser, $post, $request->get('reason'));
 }