/**
  * Get the original Url to a media-file.
  *
  * @param string $conversionName
  *
  * @return string
  *
  * @throws \Spatie\MediaLibrary\Exceptions\UnknownConversion
  */
 public function getUrl($conversionName = '')
 {
     $urlGenerator = app(UrlGenerator::class)->setMedia($this);
     if ($conversionName != '') {
         $urlGenerator->setConversion(ConversionCollectionFactory::createForMedia($this)->getByName($conversionName));
     }
     return $urlGenerator->getUrl();
 }
 /**
  * Create all derived files for the given media.
  *
  * @param \Spatie\MediaLibrary\Media $media
  */
 public function createDerivedFiles(Media $media)
 {
     if ($media->type == Media::TYPE_OTHER) {
         return;
     }
     $profileCollection = ConversionCollectionFactory::createForMedia($media);
     $this->performConversions($profileCollection->getNonQueuedConversions($media->collection_name), $media);
     $queuedConversions = $profileCollection->getQueuedConversions($media->collection_name);
     if (count($queuedConversions)) {
         $this->dispatch(new PerformConversions($queuedConversions, $media));
     }
 }