private function vote(Comment $comment, $vote)
 {
     $post = $comment->post()->get()->first();
     if ($vote == 1) {
         $voteCount = $comment->getAttributeValue('vote_count') + 1;
     } else {
         $voteCount = $comment->getAttributeValue('vote_count') - 1;
     }
     $comment->update(['vote_count' => $voteCount]);
     Auth::user()->comment_vote()->create(['up' => $vote, 'comment_id' => $comment->getAttributeValue('id')]);
     return view('posts.show', compact('post'));
 }
Esempio n. 2
0
 public function update(Request $request, Comment $comment, Album $album)
 {
     $comment->update($request->all());
     flash('Comment updated.', 'success');
     return back();
 }
Esempio n. 3
0
 public function problemUpdate(Request $request, Problem $problem, Comment $comment)
 {
     $comment->update(['body' => $request->input('value')]);
 }
Esempio n. 4
0
 public function update(Request $request, Comment $comment)
 {
     $comment->update($request->all());
     return redirect('dash/comment')->with('message', 'Page was update success.');
 }
Esempio n. 5
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Article $article, Comment $comment)
 {
     $comment->update($request->all());
     Session::flash('success', 'Comment edited');
     return Redirect::route('articles.show', $article->id);
 }