title: Laravel: JSON data in view blade
body: <p>Controller:</p>
  
  <pre><code>$commission = Commission::findOrFail($id);
  
      $json_calculation = (array) json_decode($commission-&gt;price_calculation, true);
  
      return view('tradesman.commissions-list-detail')
          -&gt;with('commission', $commission)
          -&gt;with('calculations', $json_calculation);
  </code></pre>
  
  <p>JSON:</p>
  
  <pre><code>{"price_per_hour":"180","hours":"4","material_type_1":"Something","material_price_1":"1200","material_type_2":"Something","material_price_2":"800"}
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@forelse($calculations as $calculation)
                  &lt;p&gt;{!! $calculation-&gt;price_per_hour !!}&lt;/p&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>ErrorException: Trying to get property of non-object
  </code></pre>
  
  <p>If i use just {!! $calculation !!} it works but i need something like {!! $calculation->material_type1 !!}</p>