Class 'Cloudinary\Uploader' not found
This the line of code I am using:
\Cloudinary\Uploader::destroy($story->audio_url);
And when I try to run it, it gave me the message:
Class 'Cloudinary\Uploader' not found
Can anybody help we with this?
0
-
Hi Nicolas,
When uploading non-image files (video/audio or raw files) the resource_type parameter needs to be explicitly set. In your case that would be:'resource_type' => 'video'
Please try running:
\Cloudinary\Uploader::destroy(<public_id>, 'resource_type' => 'video');
0 -
Now when I do
\Cloudinary\Uploader::destroy($story->audio_url, 'resource_type' => 'audio');
I'm getting the error:
syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'
Do I have to include something? Like require/use Cloudinary at the beginning of my file? I already did
composer require 'cloudinary/cloudinary_php:^1.20.0'
I'm using Laravel and not pure PHP, if that helps diagnose the issue.
0 -
Hi Nicolas,
Could you please try the following syntax and let me know if that works?
\Cloudinary\Uploader::destroy($story->audio_url, ['resource_type' => 'video']);
Thanks,
Loic
0
Post is closed for comments.
Comments
3 comments