title: laravel how to parse compact variable
body: <pre><code>@foreach($brand as $br)
  {{$br-&gt;brands}}
  @endforeach
  </code></pre>
  <p>i echo out my variable like this and i get this output</p>
  <pre><code>[{&quot;id&quot;:1,&quot;title&quot;:&quot;Eurboor&quot;,&quot;description&quot;:null,&quot;status&quot;:1,&quot;slug&quot;:&quot;eurboor&quot;,&quot;icon&quot;:null,&quot;sort&quot;:0,&quot;pivot&quot;:{&quot;product_category_id&quot;:4,&quot;brand_id&quot;:1}}] [] [{&quot;id&quot;:2,&quot;title&quot;:&quot;Aquasol&quot;,&quot;description&quot;:null,&quot;status&quot;:1,&quot;slug&quot;:&quot;aquasol&quot;,&quot;icon&quot;:null,&quot;sort&quot;:0,&quot;pivot&quot;:{&quot;product_category_id&quot;:6,&quot;brand_id&quot;:2}}] [{&quot;id&quot;:1,&quot;title&quot;:&quot;Eurboor&quot;,&quot;description&quot;:null,&quot;status&quot;:1,&quot;slug&quot;:&quot;eurboor&quot;,&quot;icon&quot;:null,&quot;sort&quot;:0,&quot;pivot&quot;:{&quot;product_category_id&quot;:7,&quot;brand_id&quot;:1}}] [{&quot;id&quot;:1,&quot;title&quot;:&quot;Eurboor&quot;,&quot;description&quot;:null,&quot;status&quot;:1,&quot;slug&quot;:&quot;eurboor&quot;,&quot;icon&quot;:null,&quot;sort&quot;:0,&quot;pivot&quot;:{&quot;product_category_id&quot;:8,&quot;brand_id&quot;:1}}] [{&quot;id&quot;:5,&quot;title&quot;:&quot;D.W.T&quot;,&quot;description&quot;:null,&quot;status&quot;:1,&quot;slug&quot;:&quot;dwt&quot;,&quot;icon&quot;:null,&quot;sort&quot;:0,&quot;pivot&quot;:{&quot;product_category_id&quot;:9,&quot;brand_id&quot;:5}}] [{&quot;id&quot;:3,&quot;title&quot;:&quot;Steel Weld&quot;,&quot;description&quot;:null,&quot;status&quot;:1,&quot;slug&quot;:&quot;steel-weld&quot;,&quot;icon&quot;:null,&quot;sort&quot;:0,&quot;pivot&quot;:{&quot;product_category_id&quot;:10,&quot;brand_id&quot;:3}}]
  </code></pre>
  <p>So how do i get &quot;brand_id&quot; or something else i tried $br-&gt;brands-&gt;brand_id or similar thing but it didnt work pls help me out :(</p>
  <p>/////////////////////Update</p>
  <pre><code>@foreach($brand as $br)
  @foreach($br-&gt;brands as $singlebrand)
  {{$singlebrand-&gt;id}}
  @endforeach
  @endforeach
  </code></pre>
  <p>This worked for me ty :)</p>