PHP code example of bbcreation / miniostorage

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

    

bbcreation / miniostorage example snippets


WArk\Minio\Providers\MinioStorageServiceProvider::class,

'MinioStorage' => WArk\Minio\Facades\MinioStorage::class,

MINIO_ACCESS_KEY=<access_key>
MINIO_ACCESS_SECRET=<access_secret>
MINIO_ACCESS_REGION=null
MINIO_BUCKET_NAME=<bucket>
MINIO_ACCESS_ENDPOINT=http://localhost:9000

MinioStorage::store('key/key', Input::file('file'));

$data = file_get_contents('data');
MinioStorage::store('key/key', $data, true);

MinioStorage::get('key/key');

MinioStorage::getWithBucket('bucket', 'key/key');

MinioStorage::listObjects();

MinioStorage::listObjectsWithBucket();

MinioStorage::removeObject('key');

MinioStorage::removeObjectWithBucket('bucket','key');

MinioStorage::checkBucketExist('bucketName');

MinioStorage::createBucketIfNotExist('bucketName');

MinioStorage::createBucket('bucketName');

MinioStorage::createBucketAsync('bucketName');

MinioStorage::removeBucket('bucketName');

MinioStorage::removeBucketAsync('bucketName');

MinioStorage::copyObject('key', 'toBucketName', 'toKey');

MinioStorage::copyObjectFrom('fromBucketName', 'key', 'toBucketName', 'toKey');
bat
php artisan vendor:publish