Skip to content

Instantly share code, notes, and snippets.

@cygeorgel
Last active June 21, 2018 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cygeorgel/1b30c61c7452305b40eb5bcdf954b762 to your computer and use it in GitHub Desktop.
Save cygeorgel/1b30c61c7452305b40eb5bcdf954b762 to your computer and use it in GitHub Desktop.
Upload files to Ovh Public Cloud Storage
// upload files to Ovh Public Cloud Storage
$files = Storage::disk('local')->files('/invoices/zoho/');
$disks = ['swift', 'swiftAlt'];
foreach ($files as $file) {
$filename = str_replace('invoices/zoho/', '', $file);
$content = Storage::disk('local')->get($file);
foreach($disks as $disk) {
Storage::disk($disk)->put('production/zoho/invoices-pdf/' . $filename, $content);
}
print $file . PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment