public function votedown($id)
 {
     $this->first($id);
     $vote = DB::table('votes')->where('user_id', '=', Auth::user()->id)->where('artikel_id', '=', $id)->first();
     $artikel = Artikel::findOrFail($id);
     if ($vote->algeklikt == false) {
         $artikel->value--;
         $vote->down = false;
         $vote->up = true;
         $vote->algeklikt = true;
     } elseif ($vote->down == true && $vote->up == false) {
         $artikel->value--;
         $artikel->value--;
         $vote->down = false;
         $vote->up = true;
     }
     $artikel->save();
     DB::table('votes')->where('user_id', '=', Auth::user()->id)->where('artikel_id', '=', $id)->update(['down' => $vote->down, 'up' => $vote->up, 'algeklikt' => $vote->algeklikt]);
     Session::put('notiftype', 'success');
     Session::put('notifmessage', 'You have downvoted "' . $artikel->title . '"');
     return back();
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function confirmdestroy($id)
 {
     $artikel = Artikel::findOrFail($id);
     Session::put('notiftype', 'warning');
     Session::put('notifmessage', 'Are you sure you want to delete "' . $artikel->title . '" comment?');
     Session::put('delete', 'TRUE');
     return back();
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $comment = Comment::findOrFail($id);
     $this->validate($request, ['comment' => 'required|max:255']);
     $data = $request->only('comment');
     $comment->update($data);
     $artikel = Artikel::findOrFail($request->artikel_id);
     $comments = Comment::with('user')->where('artikel_id', '=', $id)->get();
     Session::put('notiftype', 'success');
     Session::put('notifmessage', 'comment edited succesfully.');
     return back();
 }