cloudinary-community / cloudinary-laravel

Laravel SDK for Cloudinary
MIT License
255 stars 71 forks source link

Can't find doc's on how to delete a file from my API #77

Closed k4l3b4 closed 1 year ago

k4l3b4 commented 1 year ago

I'm trying to have an edit function and if the user changes their image I wanna delete the former one from the Cloudinary storage but couldn't find any resources. i'm storing images using 'profile_pic' => Cloudinary::upload($request->file('profile_pic')->getRealPath())->getSecurePath(), using: Laravel 9

can any one point me to the right place?

jgodstime commented 1 year ago

I found this

use CloudinaryLabs\CloudinaryLaravel\Facades\Cloudinary;

Cloudinary::destroy($user->profile_photo_path)
k4l3b4 commented 1 year ago

Does profile_photo_path refer to the name of the column that stores the link to the image?

k4l3b4 commented 1 year ago

Does profile_photo_path refer to the name of the column that stores the link to the image?

k4l3b4 commented 1 year ago

Does profile_photo_path refer to the name of the column that stores the link to the image?

k4l3b4 commented 1 year ago

@jgodstime Does profile_photo_path refer to the name of the column that stores the link to the image?

jgodstime commented 1 year ago

@jgodstime Does profile_photo_path refer to the name of the column that stores the link to the image?

Yes

k4l3b4 commented 1 year ago

Okay, I'll try it thanks

On Sun, Feb 19, 2023, 11:01 PM Godstime John @.***> wrote:

@jgodstime https://github.com/jgodstime Does profile_photo_path refer to the name of the column that stores the link to the image?

Yes

— Reply to this email directly, view it on GitHub https://github.com/cloudinary-devs/cloudinary-laravel/issues/77#issuecomment-1436079577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOEQOAGJ4IEGZ5XZ33HWP6TWYJ3YZANCNFSM6AAAAAAQHP2NQE . You are receiving this because you authored the thread.Message ID: @.***>