public function canConvert(Media $media) : bool { if (!$this->requirementsAreInstalled()) { return false; } if ($this->supportedExtensions()->contains(strtolower($media->extension))) { return true; } $urlGenerator = UrlGeneratorFactory::createForMedia($media); if (method_exists($urlGenerator, 'getPath') && file_exists($media->getPath()) && $this->supportedMimetypes()->contains(strtolower(File::getMimetype($media->getPath())))) { return true; } return false; }
public function getMimeAttribute() : string { return File::getMimetype($this->getPath()); }