parse array in laravel blade
<p>my view page consist <code>{{$data-&gt;attachment}}</code> which render</p>

<p><code>[{"filename":"hello.jpg", "location":"/home/my_folder"}]</code>.</p>

<p>Here i tried to display file name in <code>view</code> page using </p>

<pre><code>@foreach($data-&gt;attachment as $attachment)
   $attachment-&gt;filename
@endforeach
</code></pre>

<p>which gives me</p>

<blockquote>
  <p>Invalid argument supplied for foreach()</p>
</blockquote>

<p>i trying </p>

<p><code>{{$data-&gt;attachment-&gt;filename}}</code></p>

<p>which gives me</p>

<blockquote>
  <p>Trying to get property of non-object</p>
</blockquote>

<p>what i'm doing wrong? how can i display filename? thanks.</p>