From: Abijeet Date: Sun, 11 Jun 2017 06:11:33 +0000 (+0530) Subject: #47 - Putting the comments right under the page. X-Git-Tag: v0.18.0~1^2~45^2^2~2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/fd50efb503bf626934aa868b4d02b589e498842b #47 - Putting the comments right under the page. --- diff --git a/app/Page.php b/app/Page.php index c9823e7e4..d722e4e54 100644 --- a/app/Page.php +++ b/app/Page.php @@ -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 diff --git a/resources/views/pages/show.blade.php b/resources/views/pages/show.blade.php index 480a7603e..c63444344 100644 --- a/resources/views/pages/show.blade.php +++ b/resources/views/pages/show.blade.php @@ -46,13 +46,13 @@ -
+