zettz's avatar
Level 1

Need guide for user image gallery

Hi there, I know this is a basic question but I got stuck on how to create user image upload with category based on logged in user, the tables are like these:

User table: |id|username|email

Category table: |id|cat_name|

Image table: |id|user_id|cat_id|img_name|img_file|

I need a little guide in how to make the route and store to database.

Thank you.

0 likes
3 replies
zettz's avatar
Level 1

I found the answer after I modify a little at my route, the controller worked fine, only route, got some error.

SyedAbuthahir's avatar
Level 4

You can separate you logic like below one.

attachments(table) id | name | user_id | path

categories (table) id | cat_name | attachment_id

users (table) id | name | email | profile_picture_id (here we store our attachment ref ID)

Please or to participate in this conversation.