I built a website (Larvel/Vue) which lets you create a little information page.
Some would say it's a CMS or a simple site builder.
Im currently trying to add images to the items* (see db below) but I'm struggling with the general workflow the laravel way. (no problems with basic upload/store though)
The information page is seperated into sections and for example a Team Section has TeamMembers (both are Eloq Models) and those TeamMembers should have an image(s).
My current db Schema looks something like this
users
pages
product sections
products (items)
team sections
teamMembers (items)
..
Images/Files
I think I'm overengineering at this point but as usual not quite sure.
My current prototype does not do much. Whenever a image/file is uploaded I move it in specific public folder and create one eloquent entry for that.
1 Question
The image folder path is currently this /{county_code}/{page_id}/image_name. I'm wondering if this is a good idea though because I seperate the files. But what is best practice.
- 2 Or Should I put the all image just simply in one folder (or eg a folder for products/teammember) for all users?
2 Question
Should I keep track of each image in the database (in an image morph Table)? Or just put the path('s) in the product model?
If keeping track then why? (I would like to but..)
I once thought about an Wordpress-like Image Manager where you can manage all your images/files
and when you are editing a product you can click "select image". Thus this includes you can use an image on multiple parts of the page what makes above approach with the morph mechanics more complicated (n:n moph).
2.1 I keep track of + it's dynamic and it's the laravel way, everything is connected. (?)
But again what advantage is given to me or user/customer. Just more work for me..
Thank you guys in advance!