zefman's avatar

Moving between filesystems

Hello,

I am currently facing a bit of a problem using the new filesystems in Laravel 5.

Basically I need to resize upload images locally using the Intervention image library, then I want to transfer the resized image to s3.

How can I do this using the new system, if I am using the cloud driver can I reference local files like:

$filesystem->copy( 'my-cloud-destination.jpg', 'my-local-file-path.jpg' )

Does that make sense? Any help is appreciated.

0 likes
1 reply
CodePuppet's avatar

All you really need to do is something like:

function sendToCloud(Filesystem $filesystem, Cloud $cloud, $path)
{
    $contents = $filesystem->get($path);
    $cloud->put($path, $contents);
}
1 like

Please or to participate in this conversation.