From faec46069bc9b94239f25209378f7e330c8d0f4a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 13 Jun 2018 21:29:20 -0600 Subject: [PATCH] Update StatusDelete Pipeline --- app/Jobs/StatusPipeline/StatusDelete.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Jobs/StatusPipeline/StatusDelete.php b/app/Jobs/StatusPipeline/StatusDelete.php index 30aecd7e2..f48b200a3 100644 --- a/app/Jobs/StatusPipeline/StatusDelete.php +++ b/app/Jobs/StatusPipeline/StatusDelete.php @@ -58,6 +58,14 @@ class StatusDelete implements ShouldQueue } } + $comments = Status::where('in_reply_to_id', $status->id)->get(); + foreach($comments as $comment) { + $comment->in_reply_to_id = null; + $comment->save(); + Notification::whereItemType('App\Status') + ->whereItemId($comment->id) + ->delete(); + } $status->likes()->delete(); Notification::whereItemType('App\Status')