/** * Do a few checks to get the theme path for a given asset url. * * @param string $url * @return string */ protected function assetUrl($url) { if ($this->url->isValidUrl($url)) { return $url; } $theme = StylistFacade::current(); if ($theme) { $themePath = $theme->getAssetPath(); $url = "themes/{$themePath}/{$url}"; } return $url; }
/** * Determine if the given path is a valid URL. * * @param string $path * @return bool * @static */ public static function isValidUrl($path) { return \Illuminate\Routing\UrlGenerator::isValidUrl($path); }