Explorar o código

Update StatusDelete Pipeline

Daniel Supernault %!s(int64=7) %!d(string=hai) anos
pai
achega
faec46069b
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      app/Jobs/StatusPipeline/StatusDelete.php

+ 8 - 0
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')