public function combineToFile($assets = [], $destination, $localPath = null)
    {
        // Disable cache always
        $this->storagePath = null;

        // Prefix all assets
        if ($localPath) {
            if (substr($localPath, -1) !== '/') {
                $localPath = $localPath.'/';
            }
            $assets = array_map(function($asset) use ($localPath) {
                if (substr($asset, 0, 1) === '@') return $asset;
                return $localPath.$asset;
            }, $assets);
        }

        list($assets, $extension) = $this->prepareAssets($assets);

        $rewritePath = File::localToPublic(dirname($destination));
        $combiner = $this->prepareCombiner($assets, $rewritePath);

        $contents = $combiner->dump();
        File::put($destination, $contents);
    }
public function combineToFile($assets = [], $destination, $localPath = null)
    {
        // Disable cache always
        $this->storagePath = null;

        // Prefix all assets
        if ($localPath) {
            if (substr($localPath, -1) !== '/') {
                $localPath = $localPath.'/';
            }
            $assets = array_map(function($asset) use ($localPath) {
                if (substr($asset, 0, 1) === '@') return $asset;
                return $localPath.$asset;
            }, $assets);
        }

        list($assets, $extension) = $this->prepareAssets($assets);

        $rewritePath = File::localToPublic(dirname($destination));
        $combiner = $this->prepareCombiner($assets, $rewritePath);

        $contents = $combiner->dump();
        File::put($destination, $contents);
    }
public function combineToFile ( $ assets = [ ] , $ destination , $ localPath = null ) { // Disable cache always $ this -> storagePath = null ; // Prefix all assets if ( $ localPath ) { if ( substr ( $ localPath , - 1 ) !== '/' ) { $ localPath = $ localPath . '/' ; } $ assets = array_map ( function ( $ asset ) use ( $ localPath ) { if ( substr ( $ asset , 0 , 1 ) === '@' ) return $ asset ; return $ localPath . $ asset ; } , $ assets ) ; } list ( $ assets , $ extension ) = $ this -> prepareAssets ( $ assets ) ; $ rewritePath = File :: localToPublic ( dirname ( $ destination ) ) ; $ combiner = $ this -> prepareCombiner ( $ assets , $ rewritePath ) ; $ contents = $ combiner -> dump ( ) ; File :: put ( $ destination , $ contents ) ; }
Combines a collection of assets files to a destination file

$assets = [
'assets/less/header.less',
'assets/less/footer.less',
];

CombineAssets::combineToFile(
$assets,
base_path('themes/website/assets/theme.less'),
base_path('themes/website')
);

@param array $assets Collection of assets
@param string $destination Write the combined file to this location
@param string $localPath Prefix all assets with this path (optional)
@return void
Combines a collection of assets files to a destination file