]> BookStack Code Mirror - bookstack/blobdiff - app/Page.php
Added initial translation into German (formal)
[bookstack] / app / Page.php
index 1961a4f7f6bc2ec0e66824397df51c2ec8652f8e..94bcce2b590d104a905b0da0be36e934d8156258 100644 (file)
@@ -54,6 +54,15 @@ class Page extends Entity
         return $this->hasMany(PageRevision::class)->where('type', '=', 'version')->orderBy('created_at', 'desc');
     }
 
+    /**
+     * Get the files attached to this page.
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
+     */
+    public function files()
+    {
+        return $this->hasMany(File::class, 'uploaded_to')->orderBy('order', 'asc');
+    }
+
     /**
      * Get the url for this page.
      * @param string|bool $path