localMediaSource = new LocalItemSource([ 'item' => $item, 'lang' => $lang ]); } public function resolve($url) { $urlParts = parse_url($url); if (!isset($urlParts['scheme']) || !isset($urlParts['host'])) { return new MediaAsset($this->localMediaSource, ltrim($url, '/')); } else { return parent::resolve($url); } } }