I have a json column called additional_info. I want to be able to return the data held there with foreach as follows.
<a href="additional_info->Addslack->slack"><i class="additional_info->Addslack->icon"></i> additional_info->Addslack->title </a>
<a href="additional_info->Addgithub->github"><i class="additional_info->Addgithub->icon"></i> additional_info->Addgithub>title </a>
… like this
{
.....,
"Addphone":{
"icon":"fas fa-phone-alt",
"phone":"12345",
"title":"work"
},
"Addskype":{
"icon":"fab fa-skype",
"skype":null,
"title":null
},
"Addslack":{
"icon":"fab fa-slack-hash",
"slack":"slack_address",
"title":null
},
"Addgithub":{
"icon":"fab fa-github",
"title":"git",
"github":"cnahmetcn",
},
....
}
how can I do that? There are dozens of data like this.
2
Answers
i have run this code but i am not getting the result i want
Add a cast on yout model
This cast will already convert the json to vector at the time of feeding the model