Пример #1
0
 /**
  * 좋아요 추가, 삭제
  *
  * @param Request $request request
  * @param string  $menuUrl first segment
  * @param string  $option  options
  * @return \Xpressengine\Presenter\RendererInterface
  */
 public function vote(Request $request, $menuUrl, $option, $id)
 {
     $author = Auth::user();
     $item = $this->handler->getModel($this->config)->find($id);
     $this->handler->setModelConfig($item, $this->config);
     try {
         $this->handler->vote($item, $author, $option);
     } catch (GuestNotSupportException $e) {
         throw new AccessDeniedHttpException();
     }
     return $this->showVote($request, $id);
 }