Disky is a simple package of plugins for Laravel Flysystem. But right now it just allows copying from one disk to another.

v0.1.1 2017-09-19 15:04 UTC

This package is auto-updated.

Last update: 2024-04-27 03:10:20 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Disky gives you an easy way to copy a file from one disk to another in one line of code.

Install

Via Composer

$ composer require roblesterjr04/disky

Add Service Provider to config/app.php

roblesterjr04\disky\DiskyServiceProvider::class,

Usage

Storage::copyToDisk('path/to/file', 's3'); // Same as copying from disk('local');

Storage::disk('s3')->copyToDisk('path/to/file', 'ftp');

Storage::disk('ftp')->copyToDisk('path/to/file', 'local');

// Use the same logic to copy a directory

Storage::disk('ftp')->copyToDisk('path/to/directory', 's3');

Multiple Files are supported!

Storage::copyToDisk(['path/to/file1','path/to/file2'], 's3');

// You can copy to multiple disks!
Storage::copyToDisk(['path/to/file1','path/to/file2'], ['s3','ftp']);

// You can specify one or more folder destinations on the destination drive(s)
Storage::copyToDisk('path/to/file', 's3', 'destination/path');

Storage::copyToDisk('path/to/file', 'ftp', ['destination/path1', 'destination/path2']);

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.