From b7274b19b61a810a7a41b410600fe2e55bc694ad Mon Sep 17 00:00:00 2001 From: Maksim Khodyrev Date: Wed, 18 Jan 2017 15:37:08 +0400 Subject: [PATCH] make buildDir for Cdn::elixir customizable #107 --- src/Vinelab/Cdn/CdnFacade.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Vinelab/Cdn/CdnFacade.php b/src/Vinelab/Cdn/CdnFacade.php index c7a010f..cf8f1b5 100755 --- a/src/Vinelab/Cdn/CdnFacade.php +++ b/src/Vinelab/Cdn/CdnFacade.php @@ -87,19 +87,20 @@ public function asset($path) * it's CDN url. * * @param $path + * @param string $buildDir * * @return mixed * * @throws Exceptions\EmptyPathException, \InvalidArgumentException */ - public function elixir($path) + public function elixir($path, $buildDir = 'build') { static $manifest = null; if (is_null($manifest)) { - $manifest = json_decode(file_get_contents(public_path('build/rev-manifest.json')), true); + $manifest = json_decode(file_get_contents(public_path("$buildDir/rev-manifest.json")), true); } if (isset($manifest[$path])) { - return $this->generateUrl('build/' . $manifest[$path], 'public/'); + return $this->generateUrl($buildDir . '/' . $manifest[$path], 'public/'); } throw new \InvalidArgumentException("File {$path} not defined in asset manifest."); }