Storage 終極用法

use Illuminate\Support\Facades\Storage;

$base_dir = $user_id;
//logg($base_dir);
$dirs = Storage::allDirectories($base_dir);
foreach ($dirs as $key => $dir) {
	$path = Storage::path($dir);
	$files = Storage::files($dir);
	//logg($path);
	if($files == false){
		continue;
	}

	//Upload files
	//logg($files);
	foreach ($files as $key2 => $file) {
		$f_content = Storage::get($file);
		$result = Storage::disk('s3')->put($file, $f_content, 'public');
		//logg($result);

		//Delete file
		Storage::delete($file);
		$this->info('Done ' . $file);
	}
}
logg($dirs);