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:
10
app/File.php
10
app/File.php
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user