Simplify logo URL code

This commit is contained in:
Hillel Coren 2016-11-11 12:57:28 +02:00
parent 38ed834019
commit 79d745a26b

View File

@ -748,15 +748,13 @@ class Account extends Eloquent
if($adapter instanceof \League\Flysystem\Adapter\Local) { if($adapter instanceof \League\Flysystem\Adapter\Local) {
// Stored locally // Stored locally
$logo_url = str_replace(public_path(), url('/'), $adapter->applyPathPrefix($this->logo), $count); $logoUrl = url('/logo/' . $this->logo);
if ($cachebuster) { if ($cachebuster) {
$logo_url .= '?no_cache='.time(); $logoUrl .= '?no_cache='.time();
} }
if($count == 1){ return $logoUrl;
return str_replace(DIRECTORY_SEPARATOR, '/', $logo_url);
}
} }
return Document::getDirectFileUrl($this->logo, $this->getLogoDisk()); return Document::getDirectFileUrl($this->logo, $this->getLogoDisk());