Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($comment['posted_by'] == $authUser['id']) {
- $data = $post->update([
- "comments.$key.description" => $dataArray['description'],
- "comments.$key.updated_at" => $dataArray['updated_at'],
- ]);
- }
- $post = Post::where('_id', $id)->where('comments.*.id', $commentId)->update(array('description' => $desc));
- if ($subCommentId) {
- foreach ($comment as $nestedkey => $nestedComments) {
- if ($nestedComments['id'] === $subCommentId && $nestedComments['posted_by'] == $authUser['id']) {
- $data = $post->update([
- "comments.$key.$nestedkey.description" => $dataArray['description'],
- "comments.$key.$nestedkey.updated_at" => $dataArray['updated_at'],
- ]);
- }
- }
- }
- $post = Post::where('_id', $id)->where('comments.*.id', $commentId)->where('comments.*.*.id', $subCommentId)->update(array('description' => $desc));
Add Comment
Please, Sign In to add comment