]> BookStack Code Mirror - bookstack/blobdiff - app/File.php
Added view, deletion and permissions for files
[bookstack] / app / File.php
index ebfa0a29618a0e7c2a4bda01fc0f98a34206fb9d..055f217bd309efeb464bee8292a8df48a6fc28a6 100644 (file)
@@ -7,12 +7,20 @@ class File extends Ownable
 
     /**
      * Get the page this file was uploaded to.
-     * @return mixed
+     * @return Page
      */
     public function page()
     {
         return $this->belongsTo(Page::class, 'uploaded_to');
     }
 
+    /**
+     * Get the url of this file.
+     * @return string
+     */
+    public function getUrl()
+    {
+        return '/files/' . $this->id;
+    }
 
 }