PHP code example of tinywan / storage

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

    

tinywan / storage example snippets


composer 

$res = Tinywan\Storage\Storage::uploadFile();
var_dump(json_encode($res));

'local' => [
    'adapter' => \Tinywan\Storage\Adapter\LocalAdapter::class,
    'root' => public_path() . '/storage',
],

composer 

composer 

composer 

composer 

public function upload(Request $request)
{
    $base64 = $request->post('base64');
    $response = \Tinywan\Storage\Storage::disk(\Tinywan\Storage\Storage::MODE_OSS, false)->uploadBase64($base64,'png');
    var_dump($response);
}

$serverFile = runtime_path() . DIRECTORY_SEPARATOR . 'storage/webman.png';
$res = \Tinywan\Storage\Storage::disk(\Tinywan\Storage\Storage::MODE_OSS, false)->uploadServerFile($serverFile);
regexp
vendor/bin/phpstan analyse src

vendor/bin/php-cs-fixer fix src