title: How to use data in a nested object in a laravel Blade view?
body: <p>I am trying to use data in a nested object in a laravel Blade view.</p>
  
  <p>I am using Laravel 4.2.</p>
  
  <p>Here is a sample of the data, "$arContent":</p>
  
  <pre><code>stdClass Object
  (
      [h1-title] =&gt; stdClass Object
          (
              [h3-sub-title] =&gt; Safe, Affordable Self-Storage
              [img] =&gt; Array
                  (
                      [0] =&gt; Caption 1
                      [1] =&gt; Caption 2
                      [2] =&gt; Caption 4
                  )
          )
  )
  </code></pre>
  
  <p>I pass it to the view, "objects":</p>
  
  <pre><code>// show the view and pass the page and domain recrods to it
  return View::make('objects')
      -&gt;with('page', $page)
      -&gt;with('content', $arContent)
      -&gt;with('domain', $domain);
  </code></pre>
  
  <p>And here I am trying to retrieve a value in the view:</p>
  
  <pre><code>&lt;h2&gt;
  {{ $content-&gt;h1-title-&gt;h3-sub-title }}
  &lt;/h2&gt;
  </code></pre>
  
  <p>The error that I get from above is:</p>
  
  <blockquote>
    <p>Undefined property: stdClass::$h1</p>
  </blockquote>
  
  <p>I have also tried:</p>
  
  <pre><code>&lt;h2&gt;
      {{ $content-&gt;h1-title-&gt;h3-sub-title }}
  &lt;/h2&gt;
  </code></pre>
  
  <p>And I then get the following error:</p>
  
  <blockquote>
    <p>syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or
    ';'</p>
  </blockquote>
  
  <p>I think it's obvious what I am trying to do:  I want to be able to access the values of the nested object as many "layers" down as I want.  I have searched Google for the different approaches tried above and right now I don't know if Laravel is expecting something different / does not support this or if I am doing something stupid.</p>
  
  <p>Any guidance on how to do this would be appreciated.</p>