Example #1
0
 /**
  * Publish the collection of assets to the path.
  *
  * @param $path
  * @param $collection
  * @param $additionalFilters
  */
 protected function publish($path, $collection, $additionalFilters)
 {
     $path = ltrim($path, '/\\');
     if (str_contains($collection, public_path())) {
         return;
     }
     $assets = $this->getAssetCollection($collection, $additionalFilters);
     $path = $this->directory . $path;
     $this->files->makeDirectory((new \SplFileInfo($path))->getPath(), 0777, true, true);
     $this->files->put($path, $assets->dump());
     if ($this->paths->extension($path) == 'css') {
         $this->files->put($path, app('twig')->render(str_replace($this->directory, 'assets::', $path)));
     }
 }