Exemplo n.º 1
0
 /**
  * This function will be called from the CdnFacade class when
  * someone use this {{ Cdn::asset('') }} facade helper.
  *
  * @param $path
  *
  * @return string
  */
 public function urlGenerator($path)
 {
     if ($this->getCloudFront() === true) {
         $url = $this->cdn_helper->parseUrl($this->getCloudFrontUrl());
         return $url['scheme'] . '://' . $url['host'] . '/' . $path;
     }
     $url = $this->cdn_helper->parseUrl($this->getUrl());
     $bucket = $this->getBucket();
     $bucket = !empty($bucket) ? $bucket . '.' : '';
     return $url['scheme'] . '://' . $bucket . $url['host'] . '/' . $path;
 }