1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added view, deletion and permissions for files

This commit is contained in:
Dan Brown
2016-10-10 20:30:27 +01:00
parent 673c74ddfc
commit ac0b29fb6d
9 changed files with 152 additions and 20 deletions

View 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;
}
}