/**
  * Crea el comentario que se hizo en una sugerencia
  * @param $suggestionId
  * @param CommentRequest $request
  * @return Response
  */
 public function store(CommentRequest $request, $suggestionId)
 {
     $newComment = new Comment($request->all());
     Suggestion::find($suggestionId)->comments()->save($newComment);
     return redirect('results/' . $suggestionId);
     //return Redirector->refresh(['suggestionsId' => $suggestionId]);
 }
 /**
  * Muestra una sugerencia en especĂ­fica que hizo match con la busqueda
  * @integer $id
  * @return Response
  */
 public function show($id)
 {
     $suggestion = Suggestion::find($id);
     //$suggestion_comments = $suggestion->comments()->latest()->get();
     $suggestion_comments = $suggestion->comments()->latest()->paginate(4);
     $suggestion_comments->setPath('');
     return view('search.show')->with(['suggestion' => $suggestion, 'suggestion_comments' => $suggestion_comments]);
 }
Example #3
0
 public function destroy_suggestion_a($user_id)
 {
     // get the candidate user id
     $user = User::find($user_id);
     $user->grader_status = 'na';
     // get the suggestion
     $suggestion = Suggestion::find($user->suggestion->id);
     $suggestion->delete();
     dd($suggestion->id);
     $user->save();
 }
 /**
  * Actualiza la sugerencia
  *
  * @param  int  $id
  * @param SuggestionRequest $request
  * @return Response
  */
 public function update($id, SuggestionRequest $request)
 {
     $suggestion = Suggestion::find($id);
     $suggestion->update($request->all());
     return redirect('suggestions');
 }