public function addCommentToComment($id, array $input) { $comments = Comment::find($id); $comment = new Comment(); $comment->fill($input); $comments->comments()->save($comment); $this->linkToCurrentUser($comment); return $comment; }
public function store(Request $request) { $comment = new Comment(); $comment->fill($request->all()); $comment->user_id = Auth::user()->id; $comment->recipe_id = $request->get('recipe_id'); $comment->save(); return Comment::with('author')->where('id', $comment->id)->first(); }
/** * Updates Comment into database * * @param Comment $comment * @param array $input * * @return Comment */ public function update($comment, $input) { $comment->fill($input); $comment->save(); return $comment; }