Example #1
0
 /**
  * Get asset url from a specific module.
  *
  * @param string $asset
  * @param bool   $secure
  *
  * @return string
  */
 public function asset($asset)
 {
     list($name, $url) = explode(':', $asset);
     $baseUrl = str_replace(public_path(), '', $this->getAssetsPath());
     $url = public_asset($baseUrl . "/{$name}/" . $url);
     return str_replace(['http://', 'https://'], '//', $url);
 }
Example #2
0
 /**
  * Get image route.
  *
  * @param string $type
  * @param string $image
  *
  * @return string
  */
 function image_route($type, $image)
 {
     if ($image) {
         $image = '/' . $image;
     }
     return public_asset(config("zedx.images.{$type}.path") . $image);
 }