]> BookStack Code Mirror - bookstack/blobdiff - app/Page.php
Removes some unused code.
[bookstack] / app / Page.php
index d53e02a0bab041cd882f91aaaa560f62a8abf36b..d722e4e545e822aeeb511013fffb035fa1b8c985 100644 (file)
@@ -8,7 +8,7 @@ class Page extends Entity
     protected $simpleAttributes = ['name', 'id', 'slug'];
 
     protected $with = ['book'];
-    protected $textField = 'text';
+    public $textField = 'text';
 
     /**
      * Converts this page into a simplified array.
@@ -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