PHP code example of koffinate / laravel-filesystem

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

    

koffinate / laravel-filesystem example snippets


// put content into file
Storage::disk('minio')->put('file.jpg', $contents);

// read file contents
$contents = Storage::disk('minio')->get('file.jpg');

// check file is exists
if (Storage::disk('minio')->exists('file.jpg')) {
    // ...
}

// check file is missing or not exists
if (Storage::disk('minio')->missing('file.jpg')) {
    // ...
}

// store on folder
$request->file('files')->store('path-to-folder', 'minio');

// store on folder with new name
$request->file('files')->storeAs('path-to-folder', 'file.jpg', 'minio');
bash
php artisan koffinate:minio-config