Copying a file using 2 disks with Laravel
@ceejayoz has a good answer, but as mentioned in the comments, this fetches, and then writes.
In order to use streams, the following can be used instead:
Storage::disk('FTP')->writeStream('new/file1.jpg', Storage::readStream('old/file1.jpg'));
A simple combination of Storage::get
and Storage::put
should do the trick.
Storage::disk('FTP')->put('new/file1.jpg', Storage::get('old/file1.jpg'));