meema / flysystem-meema
Flysystem adapter for the Meema API
Requires
- php: ^7.0 || ^8.0
- guzzlehttp/guzzle: ^7.3
- league/flysystem: ^1.0.70
- meema/meema-client-php: dev-main
- vlucas/phpdotenv: ^5.3
Requires (Dev)
- orchestra/testbench: ^6.17
- pestphp/pest: ^1.0
- symfony/var-dumper: ^5.2
- dev-main
- 0.1.1
- 0.1.0
- dev-dependabot/composer/vlucas/phpdotenv-5.5.0
- dev-dependabot/composer/orchestra/testbench-6.25.1
- dev-dependabot/composer/guzzlehttp/guzzle-7.5.0
- dev-dependabot/composer/laravel/framework-8.83.12
- dev-renovate/configure
- dev-dependabot/composer/guzzlehttp/psr7-2.2.1
- dev-dependabot/composer/pestphp/pest-1.21.1
- dev-dependabot/composer/league/flysystem-1.1.8
- dev-dependabot/composer/symfony/http-kernel-5.3.12
- dev-test-cases
- dev-fix-namespace-sdk
- dev-develop
This package is auto-updated.
Last update: 2024-12-18 00:07:30 UTC
README
The most simple way to integrate Meema and your PHP/Laravel project
Documentation โข PHP Client โข Report a bug โข FAQ โข Discord
๐ Installation
This package contains a Flysystem adapter for Meema.
You can install the package via composer:
composer require meema/flysystem-meema
๐ก Usage
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');
๐งช Testing
composer test
๐ Changelog
Please see our releases page for more information on what has changed recently.
๐ช๐ผ Contributing
Please see CONTRIBUTING for details.
๐ Community
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:
๐จ Security
Please review our security policy on how to report security vulnerabilities.
๐๐ผ Credits
๐ License
The MIT License (MIT). Please see LICENSE for more information.
Made with โค๏ธ by Meema, Inc.