예제 #1
0
 /**
  * Catches and runs operations when a comment is deleted.
  *
  * @param Comment $comment
  */
 public function deleting(Comment $comment)
 {
     // Make sure the model isn't soft deleted.
     if (!$comment->deleted_at) {
         $files = $comment->files()->get();
         foreach ($files as $file) {
             $file->delete();
         }
     }
 }