/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Comment $result)
 {
     $attributes = $result->all();
     $attributes['type_id'] = 0;
     if (!captcha_check($attributes['captcha'])) {
         Notification::error('验证码错误');
         return redirect()->route('article.show', ['id' => $attributes['el_id'], '#commentList'])->withInput();
     }
     unset($attributes['captcha']);
     if (Session::token() !== $attributes['_token']) {
         Notification::error('token错误');
         return redirect()->route('article.show', ['id' => $attributes['el_id'], '#commentList'])->withInput();
     }
     unset($attributes['_token']);
     try {
         $attributes['content'] = htmlspecialchars($attributes['content']);
         CommentModel::create($attributes);
         ArticleStatus::updateCommentNumber($attributes['el_id']);
         Notification::success('评论成功');
         return redirect()->route('article.show', ['id' => $attributes['el_id'], '#commentList']);
     } catch (\Exception $e) {
         Notification::error($e->getMessage());
         return redirect()->route('article.show', ['id' => $attributes['el_id'], '#commentList'])->withInput();
     }
 }