1. Go to this page and download the library: Download joytekmotion/zoho-workdrive library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Providers;
use Illuminate\Support\Facades\Storage;
use Joytekmotion\Zoho\Workdrive\WorkdriveAdapter;
use Joytekmotion\Zoho\Oauth\SelfClient;
use Illuminate\Filesystem\FilesystemAdapter;
use League\Flysystem\Filesystem;
publc function boot()
{
Storage::extend('workdrive', function ($app, $config) {
$adapter = new WorkDriveAdapter(
new SelfClient(
config('zoho.oauth_base_url'),
$config['client_id'],
$config['client_secret'],
$config['refresh_token']
)
);
return new FilesystemAdapter(
new Filesystem($adapter, $config), $adapter, $config
);
});
}
use Illuminate\Support\Facades\Storage;
Storage::disk('workdrive')->put('virtual-folder-id/file.txt', 'contents');
use Illuminate\Support\Facades\Storage;
$contents = Storage::disk('workdrive')->get('virtual-folder-id/file.txt');
use Illuminate\Support\Facades\Storage;
$exists = Storage::disk('workdrive')->exists('virtual-folder-id/file.txt');