t0berius
1 week ago
294
2
General

move folder from storageDisk to another (flysystem)

Posted 1 week ago by t0berius

Is there a shorter way than:

                $folderName = "xyz";

                $images = Storage::disk('public')->files($folderName);

                foreach ($images as $image) {
                    Storage::disk('private')->writeStream($image,
                        Storage::disk('public')->readStream($image)
                    );
                }

                Storage::disk('public')->deleteDirectory($folderName);

Maybe a shortcut to move a whole folder from disk1 to disk2?

Please sign in or create an account to participate in this conversation.