0

let me describe the scenario first:

We need an Image model which holds all images of that project, like,

Country has `single` image and `multiple images` for gallery,

Store has `single` image, logo and `multiple images` for gallery,

... and so on

I tried classic-o/nova-media-library, spatie/laravel-medialibrary and trust me, these works like charm... But we need to make it simple, light-weight and don't want to use unnecessary dependencies, so,

We make an Image model based on Polymorphic Many-to-many relationship.

Now the problem is that, we dont know how to use this for single image columns, like, country image, store image and logo, ...

CURRENT STATUS: Currently we're using type field with filter inside model to identify the image type

Sorry for any typo & grammar mistakes...

Regards

4

0 回答 0