Пример #1
0
 /**
  * Update comment
  *
  * @return Response
  */
 public function postUpdate($id = null, \App\Http\Requests\CommentRequest $request)
 {
     if (!isset($id) or is_null($id)) {
         return redirect()->action('BookmarkController@getNewsFeed')->with('flash_message', trans('comment.not_valid'));
     }
     $comment = $this->comment->find($id);
     if (is_null($comment)) {
         return redirect()->action('BookmarkController@getNewsFeed')->with('flash_message', trans('comment.not_found'));
     }
     $this->comment->update($id, $request->only('content'));
     return redirect()->action('BookmarkController@getRead', array($comment->bookmark_id))->with('flash_message', trans('comment.update_success'));
 }
 /**
  * @param CommentRequest $request
  * @param CommentService $comment
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(CommentRequest $request, CommentService $comment)
 {
     $params = $request->only(['name', 'comment', 'entry_id']);
     $comment->addComment($params);
     return redirect()->route('entry.show', [$params['entry_id']]);
 }