Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

How to delete images #25

Closed
vnzlogin opened this issue May 15, 2018 · 2 comments
Closed

How to delete images #25

vnzlogin opened this issue May 15, 2018 · 2 comments

Comments

@vnzlogin
Copy link

I want to delete images when delete row product, this library is not supported?

@deanlaw
Copy link

deanlaw commented May 15, 2018

@phamvansy This package is only for uploading and manipulating the image. Once the image has been uploaded, you would handle the deleting of that image the same way you would handle any other file asset that has been uploaded to the server. If you want to have the image deleted automatically when you delete the product that it is associated, you would need to create an Event (https://laravel.com/docs/5.6/events) that is fires when you delete the product (see https://laravel.com/docs/5.6/eloquent#events). Within this event's listener, you would place your code to delete the associated image.

@matriphe
Copy link
Owner

matriphe commented Jun 1, 2018

@deanlaw is right. this package only provides way for uploading and resizing image. It still doesn't support deletion. I'm afraid you have to delete the image manually.

If you have idea about how to automate this, I'm open for PR.

@matriphe matriphe closed this as completed Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants