Download the PHP package mdhesari/laravel-flysystem-cloudinary without Composer
On this page you can find all versions of the php package mdhesari/laravel-flysystem-cloudinary. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mdhesari/laravel-flysystem-cloudinary
More information about mdhesari/laravel-flysystem-cloudinary
Files in mdhesari/laravel-flysystem-cloudinary
Package laravel-flysystem-cloudinary
Short Description Cloudinary Flysystem v1 integration with Laravel
License MIT
Homepage https://github.com/codebar-ag/laravel-flysystem-cloudinary
Informations about the package laravel-flysystem-cloudinary

💡 What is Cloudinary?
Cloudinary is basically a fantastic way to store and serve assets like images or videos. You can upload your full resolution image to Cloudinary, and they handle the optimization for you. The only thing you have to do is to add additional parameters to your url 😉
🛠 Requirements
- PHP:
^8.0
- Laravel:
^8.12
- league/flysystem:
^1.1
(default in Laravel 8) - Cloudinary Account
⚙️ Installation
You can install the package via composer:
Add the following disk to your filesystem "disks" list in your filesystems.php
configuration:
Add the following environment variables to your .env
file:
🏗 File extension problem
Let's look at the following example:
This will generate following URL with double extensions:
To prevent this you should store your images without the file extension:
This is now much better:
🪐 How to use with Nova
To customize the name of the stored file, you may use the storeAs
methods
of the Image
field:
🗂 How to use folder prefix
Imagine the following example. We have different clients but want to store the assets in the same Cloudinary account. Normally we have to prefix every path with the correct client folder name. Fortunately, the package helps us here. We can configure a folder in our environment file like this:
Now all our assets will be prefixed with the client_cat/
folder. When we
store following image:
It will produce following URL:
In the Media Library it is stored in client_cat/meow
and you can retrieve
the image with meow
:
This should increase the trust to store and retrieve your assets from the correct folder.
🔋 Rate limit gotchas
All files in Cloudinary are stored with a resource type. There are three kinds
of it: image
, raw
and video
. For example if we want to check if a video
exists, we need to make up to 3 requests. Every type needs to be checked on
their own with a separate request.
Keep this in mind because the admin API is rate limited to 500 calls per hour.
The package does check in following sequence:
image
➡️raw
➡️video
🔧 Configuration file
You can publish the config file with:
This is the contents of the published config file:
🚧 Testing
Run the tests:
📝 Changelog
Please see CHANGELOG for more information on what has changed recently.
✏️ Contributing
Please see CONTRIBUTING for details.
🧑💻 Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
🙏 Credits
- Ruslan Steiger
- Sebastian Fix
- All Contributors
- Skeleton Repository from Spatie
- Laravel Package Training from Spatie
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-flysystem-cloudinary with dependencies
friendsofphp/php-cs-fixer Version 3.0.0
guzzlehttp/guzzle Version ^7.0.1
illuminate/contracts Version ^8.0
spatie/laravel-package-tools Version ^1.4.3
cloudinary/cloudinary_php Version ^2.2.0