The package contains a flysystem adapter for cloudinary. Under the hood Cloudinary PHP SDKis used.
This package is still under active development but fill free to try out leave a PR or file an issue incase of any challenge
You can install the package via composer:
composer require jasirilabs/flysystem-cloudinaryThen follow the steps on using custom filesystem with laravel.
Quick Start
FILESYSTEM_DISK=
CLOUDINARY_NAME=
CLOUDINARY_KEY=
CLOUDINARY_SECRET=Add cloudinary disk in filesystem.php
...
'disk' =>
[
...
'cloudinary' => [
'driver' => 'cloudinary',
'name' => env('CLOUDINARY_NAME'),
'key' => env('CLOUDINARY_KEY'),
'secret' => env('CLOUDINARY_SECRET'),
]Add the following on boot method of AppServiceProvider.php file
Storage::extend('cloudinary', function ($app, $config) {
$configuration = new Configuration();
$configuration->cloud->cloudName = $config['name'];
$configuration->cloud->apiKey = $config['key'];
$configuration->cloud->apiSecret = $config['secret'];
$configuration->url->secure = true;
$cloudinary = new Cloudinary($configuration);
$adapter = new CloudinaryAdapter($cloudinary);
return new FilesystemAdapter(
new Filesystem($adapter, $config),
$adapter,
$config
);
});composer testPlease see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email hello@brunoalfred.me instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the PHP Package Boilerplate by Beyond Code.