json_decode() the JSON (which I would suggest is done in the Controller - give data to the view in the format that it uses the data)
@foreach ( json_decode($product->tags['data'])->tags as $tag)
{{$tag->type}}
@endforeach
Hello, im trying to iterate in a foreach loop a json object, but with no success, it keeps giving me error regarding html entities.
The data im trying to output in my foreach is:
data: variable that is stored the data above is '$product->tags['data']'
{"tags":[{"type":"circle","points":[[1.0449999570846558,0.5450000166893005],[0.9850000143051147,0.4399999976158142]],"popup":{"title":"my title","description":"my description"}},{"type":"rectangle","points":[[0.03500000014901161,0.125],[0.3400000035762787,0.6000000238418579]],"popup":{"title":"roupa","description":"guardar roupa"}}]}
My code: @foreach($product->tags['data']->tags as $tag){ {{$tag->type}} }
Please or to participate in this conversation.