1
0
Fork 1
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:
Daniel Supernault 2019-01-21 12:18:08 -07:00
parent cd6b66b8e6
commit d34eb425b0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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];