PHP code example of gumphp / think-storage

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

    

gumphp / think-storage example snippets


# config/filesystem.php

return [
    'disks' => [
        's3' => [
            'type' => 'aws',
            'root' => '/',
            'credentials' => [
                'key' => env('S3_KEY', ''),
                'secret' => env('S3_SECRET', ''),
            ],
            'version' => env('S3_VERSION', 'latest'),
            'region' => env('S3_REGION', 'us-west-2'),
            'bucket' => env('S3_BUCKET', ''),
        ],
    ],
];


use GumPHP\Storage\Facade\Storage;

Storage::disk('s3')->put('/s3/remote/file.ext', file_get_contents('/path/yourfile.ext'));