title: Getting [Trying to get property of non-object] when using ->
body: <p>I want to get fruits:</p>
  
  <pre><code>'target' =&gt; '{"fruits":{"serves":[{"value":["apple"],"option":"first"}],"excludes":[{"value":["タグ2"],"option":"first"}]}}',
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>$target = $request-&gt;target;
  $fruits = $target-&gt;fruits; //getting "Trying to get property of non-object" here
  </code></pre>
  
  <p>I tried <code>json_decode($target-&gt;fruits)</code> and <code>$target['fruits']</code>, but I got error again.
  What I do to get that fruits??</p>