Recent Topics

Connection with third party media application



  • Currently we have media application in our website builder project where we keep our media file (images, videos, docs, etc. ...) we want to integrate that part with e-commerce platform. After the integration we want to be able to choose images from the media app and connect those images with products and categories, etc. How we can implement that part with bagisto? For example to store the media ids somewhere inside products or categories



  • Hi @k3rnel,

    For this, first of all, you need a centralized table which holds all the values otherwise you need to loop all the model which associated with the images.

    For e.g. Product images and videos are inside the product_images and product_videos table. You need to start with making one common table for all assets. So that your looping can be easy and all assets will be at centralized.



  • Hi @devansh-webkul ,

    Since we will be working with several entities, I propose this solution: we can create the media_references table. In which there will be columns: id | entity_id | entity_type | media_id | media_type (media_type is (video, image, docs, etc.)). This way we can connect media and entities by polymorphic relationships. What do you think about it?



  • Hi @k3rnel,

    Yeah, exactly the main focus should be centralized everything. Because this will also help you to build a media module in your app as well like managing all media from a central place.


Log in to reply