How can I add a user model to this where user has many products and product belong to user.
Manjusha Mammen

Hi Manjusha. Add a user_id column in product model, which stores the user who created the product. Also add user_id column in category model. Then create a mapping table which maps category_id and product_id. This way a product can belong to multiple categories and a category can have multiple products.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.