I have a JSON response from api with the structure:
{
Product: {
id: "3",
Video: [
{
id: "1",
url: "c",
},
{
url: "d",
},
]
}
}
In my Product model, I set Video model as related:
...
initialize(){
$this->hasMany("id","Video","product_id")
}
...
Is possible to save/create these related objects automaticaly?