X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/070d4aeb6ca9af987c551aede0e3b37688a0808e..refs/pull/494/head:/app/Page.php diff --git a/app/Page.php b/app/Page.php index d53e02a0b..d722e4e54 100644 --- a/app/Page.php +++ b/app/Page.php @@ -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