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')); }
public function update(Request $request, Comment $comment, Album $album) { $comment->update($request->all()); flash('Comment updated.', 'success'); return back(); }
public function problemUpdate(Request $request, Problem $problem, Comment $comment) { $comment->update(['body' => $request->input('value')]); }
public function update(Request $request, Comment $comment) { $comment->update($request->all()); return redirect('dash/comment')->with('message', 'Page was update success.'); }
/** * 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); }