Reputation: 47
Hi In may project I have tow models Post and Products And they have galleryimage my question is how can use one table for gallery to handle it?
or better way is using tow separate gallery table for each model like PostGallery and ProductGallery?
relation between gallery and post or product is one to many.
Upvotes: 0
Views: 74
Reputation: 1537
There is some solutions, first you can make separate gallery for each model, second you can make a model for storing gallery and use morph relation on it for handling which model belongs item to it, third one is using spatie medialibrary package
Upvotes: 1