|
@@ -17,6 +17,16 @@ class Media extends Model
|
|
*/
|
|
*/
|
|
protected $dates = ['deleted_at'];
|
|
protected $dates = ['deleted_at'];
|
|
|
|
|
|
|
|
+ public function status()
|
|
|
|
+ {
|
|
|
|
+ return $this->belongsTo(Status::class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function profile()
|
|
|
|
+ {
|
|
|
|
+ return $this->belongsTo(Profile::class);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function url()
|
|
public function url()
|
|
{
|
|
{
|
|
if(!empty($this->remote_media) && $this->remote_url) {
|
|
if(!empty($this->remote_media) && $this->remote_url) {
|
|
@@ -37,6 +47,11 @@ class Media extends Model
|
|
return url($url);
|
|
return url($url);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function thumb()
|
|
|
|
+ {
|
|
|
|
+ return $this->thumbnailUrl();
|
|
|
|
+ }
|
|
|
|
+
|
|
public function mimeType()
|
|
public function mimeType()
|
|
{
|
|
{
|
|
return explode('/', $this->mime)[0];
|
|
return explode('/', $this->mime)[0];
|