]> BookStack Code Mirror - bookstack/blobdiff - app/Page.php
#47 - Fixes the issues with the test case.
[bookstack] / app / Page.php
index c9823e7e4ccfcb65dce71328f28fa0f4f04d40a3..d722e4e545e822aeeb511013fffb035fa1b8c985 100644 (file)
@@ -66,6 +66,10 @@ class Page extends Entity
         return $this->hasMany(Attachment::class, 'uploaded_to')->orderBy('order', 'asc');
     }
 
+    public function comments() {
+        return $this->hasMany(Comment::class, 'page_id')->orderBy('created_on', 'asc');
+    }
+
     /**
      * Get the url for this page.
      * @param string|bool $path