Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matbeard's avatar

Move folder between disks

I know I can use Storage::move('old folder', 'new folder') to move files to a different place on the same disk.

But how would you go about moving a folder from one configured disk to a different one?

Thanks

0 likes
1 reply
Nash's avatar

Check out this thread:

https://laracasts.com/discuss/channels/laravel/how-to-move-all-files-in-directory-from-one-filesystem-to-another

To save a single file to another disk, just specify the disk (you could probably use something like Storage::files($directory) to loop through a whole directory and save the files to another disk as well):

$some_file = Storage::get('image.jpg');
Storage::disk('some-other-disk')->put('image.jpg', $some_file); 
3 likes

Please or to participate in this conversation.