public function copyStaticFiles()
    {
        $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass'];

        // Include the excludes from the config
        $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', []));

        // Create pattern
        $pattern = '/\\.(' . implode("|", $exclude) . ')$/';

        // Get list of files & directories to copy
        $to_copy = (array) $this->app->getSetting('copy', []);

        // Assets folder is hardcoded into copy
        $to_copy = array_merge(['assets'], $to_copy);
        $to_copy = array_unique($to_copy);

        // Initialize file system
        $filesystem = new Filesystem();

        // Fire event
        if ($response = Event::fire('copy.before', [$this, $to_copy])) {
            $to_copy = $response[0];
        }

        // Copy
        foreach ($to_copy as $location)
        {
            $fileInfo = new \SplFileInfo($this->source . DIRECTORY_SEPARATOR . $location);

            // Copy a complete directory
            if ($fileInfo->isDir())
            {
                $finder = new Finder();
                $finder->files()
                    ->exclude($exclude)
                    ->notName($pattern)
                    ->in($this->source . DIRECTORY_SEPARATOR . $location);

                foreach ($finder as $file)
                {
                    $path = $location . DIRECTORY_SEPARATOR . $file->getRelativePathname();
                    echo "$path\n";
                    $source = $file->getRealPath();
                    $target = $this->target . DIRECTORY_SEPARATOR . $path;

                    $filesystem->copy($source, $target);

                    $this->app->writeln("Copied: <info>$path</info>");
                }
            }

            // Copy Single File
            else {
                $filesystem->copy($fileInfo->getRealPath(), $this->target . DIRECTORY_SEPARATOR . $location);
                $this->app->writeln("Copied: <info>$location</info>");
            }
        }
    }
public function copyStaticFiles()
    {
        $exclude = ['js', 'javascripts', 'stylesheets', 'less', 'sass'];

        // Include the excludes from the config
        $exclude = array_merge($exclude, (array) $this->app->getSetting('exclude', []));

        // Create pattern
        $pattern = '/\\.(' . implode("|", $exclude) . ')$/';

        // Get list of files & directories to copy
        $to_copy = (array) $this->app->getSetting('copy', []);

        // Assets folder is hardcoded into copy
        $to_copy = array_merge(['assets'], $to_copy);
        $to_copy = array_unique($to_copy);

        // Initialize file system
        $filesystem = new Filesystem();

        // Fire event
        if ($response = Event::fire('copy.before', [$this, $to_copy])) {
            $to_copy = $response[0];
        }

        // Copy
        foreach ($to_copy as $location)
        {
            $fileInfo = new \SplFileInfo($this->source . DIRECTORY_SEPARATOR . $location);

            // Copy a complete directory
            if ($fileInfo->isDir())
            {
                $finder = new Finder();
                $finder->files()
                    ->exclude($exclude)
                    ->notName($pattern)
                    ->in($this->source . DIRECTORY_SEPARATOR . $location);

                foreach ($finder as $file)
                {
                    $path = $location . DIRECTORY_SEPARATOR . $file->getRelativePathname();
                    echo "$path\n";
                    $source = $file->getRealPath();
                    $target = $this->target . DIRECTORY_SEPARATOR . $path;

                    $filesystem->copy($source, $target);

                    $this->app->writeln("Copied: <info>$path</info>");
                }
            }

            // Copy Single File
            else {
                $filesystem->copy($fileInfo->getRealPath(), $this->target . DIRECTORY_SEPARATOR . $location);
                $this->app->writeln("Copied: <info>$location</info>");
            }
        }
    }
public function copyStaticFiles ( ) { $ exclude = [ 'js' , 'javascripts' , 'stylesheets' , 'less' , 'sass' ] ; // Include the excludes from the config $ exclude = array_merge ( $ exclude , ( array ) $ this -> app -> getSetting ( 'exclude' , [ ] ) ) ; // Create pattern $ pattern = '/\\.(' . implode ( "|" , $ exclude ) . ')$/' ; // Get list of files & directories to copy $ to_copy = ( array ) $ this -> app -> getSetting ( 'copy' , [ ] ) ; // Assets folder is hardcoded into copy $ to_copy = array_merge ( [ 'assets' ] , $ to_copy ) ; $ to_copy = array_unique ( $ to_copy ) ; // Initialize file system $ filesystem = new Filesystem ( ) ; // Fire event if ( $ response = Event :: fire ( 'copy.before' , [ $ this , $ to_copy ] ) ) { $ to_copy = $ response [ 0 ] ; } // Copy foreach ( $ to_copy as $ location ) { $ fileInfo = new \ SplFileInfo ( $ this -> source . DIRECTORY_SEPARATOR . $ location ) ; // Copy a complete directory if ( $ fileInfo -> isDir ( ) ) { $ finder = new Finder ( ) ; $ finder -> files ( ) -> exclude ( $ exclude ) -> notName ( $ pattern ) -> in ( $ this -> source . DIRECTORY_SEPARATOR . $ location ) ; foreach ( $ finder as $ file ) { $ path = $ location . DIRECTORY_SEPARATOR . $ file -> getRelativePathname ( ) ; echo "$path\n" ; $ source = $ file -> getRealPath ( ) ; $ target = $ this -> target . DIRECTORY_SEPARATOR . $ path ; $ filesystem -> copy ( $ source , $ target ) ; $ this -> app -> writeln ( "Copied: <info>$path</info>" ) ; } } // Copy Single File else { $ filesystem -> copy ( $ fileInfo -> getRealPath ( ) , $ this -> target . DIRECTORY_SEPARATOR . $ location ) ; $ this -> app -> writeln ( "Copied: <info>$location</info>" ) ; } } }
Copy static files to target
Ignoring JS, CSS & LESS - Gulp handles that

@return void
Copy static files to target Ignoring JS CSS & LESS - Gulp handles that