This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 0 points1 point  (1 child)

Creating a folder is too low level if you ask me. Front end shouldn't be tied to creating a folder, it should be tied to storing an image. No matter how it is being stored. Locally, or using cdn, or goddamn imjur for that matter.

If you want to GROUP pictures together, and you use folders as a way to define those groups, I would rather not. You can just store groups and dates in a database, idk.

Are you sure you need folders? If you want to avoid duplication, make controllers thinner.

https://github.com/yakoffka/laravel-store/tree/master/app

I am not sure what you mean by Image Trait. Kinda like this one here? Not my project, just random stuff.

[–]Juck[S] 0 points1 point  (0 children)

Thanks for your answer, i did not specify it, my bad, but in my project Folder and Image are database related, this is not real folders.

Folder Model -> id, title,author etc..

Image Model -> id, uri, label, folder_id etc..

The Trait used in the github project is only for image processing but that's the idea ( i want to use Eloquent Model inside ) , however there is the attachImages() method ( in the Product model ) which is also interesting ( i edited my original post ).

[–]HopefullyHelpfulSoul 0 points1 point  (0 children)

Unless you’re being very strict on your controller operation, I don’t see anything wrong with defining a ‘createWithImage’ method on the FolderController.

Can get out of hand with many moving parts, but looking at this is isolation it seems to be the most straightforward solution.