virgiltu's avatar

How to set one picture to default ?

I have been trying to figure this out for about a day and a half now.

I am trying to upload images with something like dropzone js, as it seems to be working well with vue. However how can I set one of the images as default? I would like to be able to press on one of them and set it as default.

Lets say that I upload 5 images but only one need to be default.

Also i am loading all of them in a database as json_encode.

So result will be something like this.

{
    "default": "main1.jpg",
    "images":["img1.jpg","img2.jpg"]
}

Thank you for all the help

0 likes
1 reply
Waseem's avatar

If you can share some of your current code it will help someone here give you an answer.

Please or to participate in this conversation.