Skip to content

Commit b7274b1

Browse files
committed
make buildDir for Cdn::elixir customizable Vinelab#107
1 parent b57823a commit b7274b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Vinelab/Cdn/CdnFacade.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,20 @@ public function asset($path)
8787
* it's CDN url.
8888
*
8989
* @param $path
90+
* @param string $buildDir
9091
*
9192
* @return mixed
9293
*
9394
* @throws Exceptions\EmptyPathException, \InvalidArgumentException
9495
*/
95-
public function elixir($path)
96+
public function elixir($path, $buildDir = 'build')
9697
{
9798
static $manifest = null;
9899
if (is_null($manifest)) {
99-
$manifest = json_decode(file_get_contents(public_path('build/rev-manifest.json')), true);
100+
$manifest = json_decode(file_get_contents(public_path("$buildDir/rev-manifest.json")), true);
100101
}
101102
if (isset($manifest[$path])) {
102-
return $this->generateUrl('build/' . $manifest[$path], 'public/');
103+
return $this->generateUrl($buildDir . '/' . $manifest[$path], 'public/');
103104
}
104105
throw new \InvalidArgumentException("File {$path} not defined in asset manifest.");
105106
}

0 commit comments

Comments
 (0)