diff --git a/app/Media.php b/app/Media.php index c1d36e558..592a684a1 100644 --- a/app/Media.php +++ b/app/Media.php @@ -32,4 +32,27 @@ class Media extends Model return url($url); } + + public function mimeType() + { + return explode('/', $this->mime)[0]; + } + + public function activityVerb() + { + $verb = 'Image'; + switch ($this->mimeType()) { + case 'image': + break; + + case 'video': + $verb = 'Video'; + break; + + default: + $verb = 'Document'; + break; + } + return $verb; + } }