]> BookStack Code Mirror - bookstack/blobdiff - app/Actions/ActivityService.php
Add unit test for ip addess searching
[bookstack] / app / Actions / ActivityService.php
index 33ed44b32efa0dd64715af5a227e90a642cc0574..73dc76de00ebf1d7feb9cf20258b9c6e163d56ea 100644 (file)
@@ -105,10 +105,10 @@ class ActivityService
         $queryIds = [$entity->getMorphClass() => [$entity->id]];
 
         if ($entity instanceof Book) {
-            $queryIds[(new Chapter())->getMorphClass()] = $entity->chapters()->visible()->pluck('id');
+            $queryIds[(new Chapter())->getMorphClass()] = $entity->chapters()->scopes('visible')->pluck('id');
         }
         if ($entity instanceof Book || $entity instanceof Chapter) {
-            $queryIds[(new Page())->getMorphClass()] = $entity->pages()->visible()->pluck('id');
+            $queryIds[(new Page())->getMorphClass()] = $entity->pages()->scopes('visible')->pluck('id');
         }
 
         $query = $this->activity->newQuery();
@@ -133,7 +133,7 @@ class ActivityService
     }
 
     /**
-     * Get latest activity for a user, Filtering out similar items.
+     * Get the latest activity for a user, Filtering out similar items.
      */
     public function userActivity(User $user, int $count = 20, int $page = 0): array
     {