businessprocess/file-storage

File storage disk for Laravel

v1.0.0 2025-01-30 07:48 UTC

This package is auto-updated.

Last update: 2025-03-01 00:42:54 UTC


README

PHP 8.x Laravel 8.x Yii 2.x Latest Stable Version Release date Release Version Total Downloads Pull requests Software License Stars

File storage to Laravel FrameWork v8.0 and above.

Installation

The recommended way to install channel is through Composer.

composer require businessprocess/file-storage

Usage BptDrive

    $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());

Usage FileStore Facade

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

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

Usage Storage

    $path = 'your-file-path'

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

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

Config

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

Config Voyager

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

Available Options

Option Description Default value
url API url (required) null
login Login (required) null
password Password (required) null

Available methods

Option Description Default value
url API url (required) null
login Login (required) null
password Password (required) null