]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Tools/TrashCan.php
Guest create page: name field autofocus
[bookstack] / app / Entities / Tools / TrashCan.php
index 1e130c9e17956cc8ecaf8db05a4d3d9807d5c67b..7341a032816ac5a10b08b39277d1cf6cc3b2c0e7 100644 (file)
@@ -344,7 +344,7 @@ class TrashCan
      *
      * @throws Exception
      */
-    protected function destroyEntity(Entity $entity): int
+    public function destroyEntity(Entity $entity): int
     {
         if ($entity instanceof Page) {
             return $this->destroyPage($entity);
@@ -376,6 +376,8 @@ class TrashCan
         $entity->searchTerms()->delete();
         $entity->deletions()->delete();
         $entity->favourites()->delete();
+        $entity->referencesTo()->delete();
+        $entity->referencesFrom()->delete();
 
         if ($entity instanceof HasCoverImage && $entity->cover()->exists()) {
             $imageService = app()->make(ImageService::class);