1
0
Daniel Supernault 6 жил өмнө
parent
commit
d34eb425b0
1 өөрчлөгдсөн 15 нэмэгдсэн , 0 устгасан
  1. 15 0
      app/Media.php

+ 15 - 0
app/Media.php

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