PHP code example of businessprocess / file-storage

1. Go to this page and download the library: Download businessprocess/file-storage 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/ */

    

businessprocess / file-storage example snippets


    $config = [
        'url' => env('FILE_STORE_URL'),
        'login' => env('FILE_STORE_LOGIN'),
        'password' => env('FILE_STORE_PASS'),      
    ];

   $storage = new \FileStorage\Drive\BptDrive(new \FileStorage\Http\Client($config));

   $file = $storage->add('1', true, $content);

   $url = $storage->getPublicUrl($file->getHash());

   $file = \FileStorage\Facades\FileStore::add('1', true, $content);

   $url = \FileStorage\Facades\FileStore::getPublicUrl($file->getHash());

    $path = 'your-file-path'

   \Storage::drive('cloud')->put($path, $content, $config);

   $url = \Storage::drive('cloud')->url($path);

    'disks' => [
       'cloud' => [
        'driver' => 'bpt-store',      
        'group' => '1',
        'visibility' => 'public',
        'throw' => true,
        ],
    ]

     'storage' => [
        'disk' => 'cloud',
    ],