public function storeComment(Request $req) { //Adds the details to the comment table and redirects $userid = Auth::id(); $comment = $req->input('comment'); $eventid = $req->input('ev'); $date = Carbon::now(); Comment::insert(['userid' => $userid, 'eventid' => $eventid, 'comment' => $comment, 'created_at' => $date]); if (Event::where('id', $eventid)->onlyTrashed()->first()) { return redirect('/past/pastDetails/' . $eventid . '#comments'); } else { return redirect('/events/details/' . $eventid . '#comments'); } }