It should go in an image model or repository.
Dec 14, 2017
5
Level 1
Should a delete image function go in the controller or model
Hi
In an online course I am taking the instructor has put his deleteImage($imagePath) function in the BlogController where it is called, I would have expected it to go in the Post model.
Where should it go?
Level 80
@tristanisginger If you’re deleting an image, then image is an entity, so it should go in an ImageController as a destroy() method.
1 like
Please or to participate in this conversation.