public function copyDirectory($directory, $destination)
    {
        $files = $this->fileSystem->allFiles($directory);
        $fileDeployed = false;
        $this->fileSystem->copyDirectory($directory, $destination);

        foreach ($files as $file) {
            $fileContents = $this->fileSystem->get($file);
            $fileDeployed = $this->fileSystem->put($destination.'/'.$file->getRelativePathname(), $fileContents);
        }

        return $fileDeployed;
    }
public function copyDirectory($directory, $destination)
    {
        $files = $this->fileSystem->allFiles($directory);
        $fileDeployed = false;
        $this->fileSystem->copyDirectory($directory, $destination);

        foreach ($files as $file) {
            $fileContents = $this->fileSystem->get($file);
            $fileDeployed = $this->fileSystem->put($destination.'/'.$file->getRelativePathname(), $fileContents);
        }

        return $fileDeployed;
    }
public function copyDirectory ( $ directory , $ destination ) { $ files = $ this -> fileSystem -> allFiles ( $ directory ) ; $ fileDeployed = false ; $ this -> fileSystem -> copyDirectory ( $ directory , $ destination ) ; foreach ( $ files as $ file ) { $ fileContents = $ this -> fileSystem -> get ( $ file ) ; $ fileDeployed = $ this -> fileSystem -> put ( $ destination . '/' . $ file -> getRelativePathname ( ) , $ fileContents ) ; } return $ fileDeployed ; }
Copy a directory and its content.

@param $directory
@param $destination

@throws \Illuminate\Contracts\Filesystem\FileNotFoundException

@return bool|int
Copy a directory and its content .