]> BookStack Code Mirror - bookstack/blobdiff - app/Repos/PageRepo.php
Merge pull request #63 from AkibaWolf/patch-1
[bookstack] / app / Repos / PageRepo.php
index 93f80ec6d513a803c937d9dc422652fd609e00cf..1acf3c84703db2e4216077048228a332ec888624 100644 (file)
@@ -358,5 +358,22 @@ class PageRepo
         $page->delete();
     }
 
+    /**
+     * Get the latest pages added to the system.
+     * @param $count
+     */
+    public function getRecentlyCreatedPaginated($count = 20)
+    {
+        return $this->page->orderBy('created_at', 'desc')->paginate($count);
+    }
+
+    /**
+     * Get the latest pages added to the system.
+     * @param $count
+     */
+    public function getRecentlyUpdatedPaginated($count = 20)
+    {
+        return $this->page->orderBy('updated_at', 'desc')->paginate($count);
+    }
 
 }