]> BookStack Code Mirror - bookstack/blobdiff - app/Actions/CommentRepo.php
feat(PageContent): set unique ids on nested headers
[bookstack] / app / Actions / CommentRepo.php
index 8121dfc5cf807b2fb95c2d714e9e7203c7480314..8061c4542e7a86fe2f4d080677e1b1300bfd7372 100644 (file)
@@ -90,8 +90,9 @@ class CommentRepo
      */
     protected function getNextLocalId(Entity $entity): int
     {
-        $comments = $entity->comments(false)->orderBy('local_id', 'desc')->first();
+        /** @var Comment $comment */
+        $comment = $entity->comments(false)->orderBy('local_id', 'desc')->first();
 
-        return ($comments->local_id ?? 0) + 1;
+        return ($comment->local_id ?? 0) + 1;
     }
 }