title: foreach get data from variable in laravel
body: <p>my input looks like this </p>
  
  <pre><code>array:3 [
    "year" =&gt; "2018"
    "tableData" =&gt; array:1 [
      0 =&gt; "DT_NSO_1100_008V1"
    ]
    "viewType" =&gt; "1"
  ]
  </code></pre>
  
  <p>and I need to get tableData's code, I used foreach but it gives me an error </p>
  
  <pre><code>foreach ($input['tableData'] as $key =&gt; $value) {
        $ushChildTable = UshTableCode::where('code', $value)-&gt;first();
  }
  </code></pre>
  
  <p>and my error looks like this 
  <a href="https://i.stack.imgur.com/r8lEq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r8lEq.png" alt="enter image description here"></a></p>
  
  <p>how to can I get these code guys?</p>