The most simple way to integrate Meema and your PHP/Laravel project
Documentation • PHP Client • Report a bug • FAQ • Discord
This package contains a Flysystem adapter for Meema.
You can install the package via composer:
composer require meema/flysystem-meema
The first thing you need to do is get an API Key at Meema.io. An API Key can easily be generated in Meema's Dashboard once you are logged in. For a more detailed step-by-step instructions, explore our documentation here.
use League\Flysystem\Filesystem;
use Meema\Client;
use Meema\FlysystemMeema\MeemaAdapter;
$client = new Client($authorizationToken);
$adapter = new MeemaAdapter($client);
$filesystem = new Filesystem($adapter);
For extending the storage, you have to simply put following into the boot-method of your service provider:
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));
});
}
After extending the storage, you can set meema
as the filesystem driver in your .env
-file or in your filesystem's config file.
FILESYSTEM_DRIVER=meema
'disks' => [
// ...
'meema' => [
'driver' => 'meema',
'api_secret' => env('MEEMA_API_SECRET'),
],
]
Read more about custom filesystems here.
After extending and defining the filesystem driver, you can then use Laravel's "Storage"-facade as follows:
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');
composer test
Please see our releases page for more information on what has changed recently.
Please see CONTRIBUTING for details.
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using this package:
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see LICENSE for more information.
Made with ❤️ by Meema, Inc.