PHP code example of meema / flysystem-meema

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

    

meema / flysystem-meema example snippets


use League\Flysystem\Filesystem;
use Meema\Client as MeemaClient;
use Meema\FlysystemMeema\MeemaAdapter;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    Storage::extend('meema', function ($app, $config) {
        $client = new MeemaClient(
            $config['api_secret']
        );

        return new Filesystem(new MeemaAdapter($client));
    });
}

'disks' => [
    // ...
    'meema' => [
        'driver' => 'meema',
        'api_secret' => env('MEEMA_API_SECRET'),
    ],
]

use Illuminate\Support\Facades\Storage;

$storage = Storage::disk('meema');

$storage->put('photos/image.jpg', $file);
$storage->getMetadata('photos/image.jpg');
$storage->getVisibility('photos/image.jpg');
$storage->setVisibility('photos/image.jpg', 'private');
$storage->path('photos/image.jpg');
$storage->copy('photos/image.jpg', 'photos/copied-image.jpg');
$storage->rename('photos/image.jpg', 'photos/renamed-image.jpg');