]> BookStack Code Mirror - bookstack/blobdiff - app/Page.php
Update/fix german translation
[bookstack] / app / Page.php
index 4a8d32780388565d668eca10ad249beb929d3c61..d722e4e545e822aeeb511013fffb035fa1b8c985 100644 (file)
@@ -38,15 +38,6 @@ class Page extends Entity
     {
         return $this->belongsTo(Chapter::class);
     }
-    
-    /**
-     * Get the comments in the page.
-     * @return \Illuminate\Database\Eloquent\Relations\HasMany
-     */
-    public function comment()
-    {
-        return $this->hasMany(Comment::class);
-    }
 
     /**
      * Check if this page has a chapter.
@@ -75,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