{
"swift":
{
"type":"text",
"value":"WF0987"
},
"routing_number":
{
"type":"text",
"value":"8402984302"
},
"bank_address":
{
"type":"text",
"value":"BullDog 57483, USA"
},
"purpose_of_transfer":
{
"type":"text",
"value":"FAMILY SUPPORT"
}
}
i have an obj inside another obj
i want to retrieve the value of each key
this is my solution
@foreach ($transfer->beneficiary->details as $key => $item)
<li class="list-group-item d-flex flex-wrap justify-content-between">
<span>
ucFirst($key)
</span>
<span class="text--info font-weight-bold">
{{ $key()?['value'] }}
</span>
</li>
@endforeach
displaying the key works but not the value child
how should i do it so that it works??
2
Answers
This worked for me
{{ $item->value }}
thanks to @Barmar for his contributionso this was my final code
You can also use the
->
operator to access the value property like this:{{ $item->value }}