Ejemplo n.º 1
0
 /**
  * Add a comment/reply to the review
  *
  * @return Response
  */
 public function comment()
 {
     $me = Input::get('user');
     $review = Input::get('review');
     $comment = Input::get('comment');
     // checking if reply already posted
     $check = DB::table('review_comments')->where('rc_user_id', $me)->where('rc_review_id', $review)->first();
     // adding new comment
     $err = new Comment();
     $err->rc_review_id = $review;
     $err->rc_user_id = $me;
     $err->rc_comment = $comment;
     $err->rc_date = \time();
     $err->save();
     // getting the user
     $user = DB::table('film_review')->where('fr_id', $review)->first();
     //
     /*
     $reply = Comment::where('rc_user_id', $err->rc_user_id)
     					->where('rc_review_id', $err->rc_review_id)
     					->leftJoin('users','users.id','=','rc_user_id')
     					->orderBy('rc_date','desc')
     					->select('rc_id','rc_date','rc_comment','rc_review_id','rc_user_id','id','usr_fname','usr_lname','username','usr_image')
     					->first();
     */
     //$this->notification($me,$user,$review);
     //$this->replyMail($me, $user->fr_usr_id, $user->fr_fl_id, $user);
     //return View::make('admin.rev', compact('reply'));
     return Redirect::to(Config::get('url.home') . "admin/reviews");
 }
Ejemplo n.º 2
0
 public function getNew()
 {
     $comment = new Comment();
     $comment->user_id = 1;
     $comment->title = md5(time() * rand());
     $comment->content = md5(time() * rand());
     $comment->link = '';
     $comment->save();
 }