mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 00:05:29 +00:00
Update Media Model
This commit is contained in:
parent
cd6b66b8e6
commit
d34eb425b0
1 changed files with 15 additions and 0 deletions
|
@ -17,6 +17,16 @@ class Media extends Model
|
|||
*/
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
public function status()
|
||||
{
|
||||
return $this->belongsTo(Status::class);
|
||||
}
|
||||
|
||||
public function profile()
|
||||
{
|
||||
return $this->belongsTo(Profile::class);
|
||||
}
|
||||
|
||||
public function url()
|
||||
{
|
||||
if(!empty($this->remote_media) && $this->remote_url) {
|
||||
|
@ -37,6 +47,11 @@ class Media extends Model
|
|||
return url($url);
|
||||
}
|
||||
|
||||
public function thumb()
|
||||
{
|
||||
return $this->thumbnailUrl();
|
||||
}
|
||||
|
||||
public function mimeType()
|
||||
{
|
||||
return explode('/', $this->mime)[0];
|
||||
|
|
Loading…
Reference in a new issue