Laravel: How do I parse this json data in view blade?

后端 未结 8 1380
耶瑟儿~
耶瑟儿~ 2020-11-29 03:11

Currently this is my view

{{ $leads }}

And this is the output

{\"error\":false,\"member\":[{\"id\":\"1\",\"firstName\":\"fi         


        
8条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 03:47

    For such case, you can do like this

    @foreach (json_decode($leads->member) as $member)
         {{ $genre }}
    @endforeach
    

提交回复
热议问题