title: Undefined index in array element
body: <p>seem to be experiencing something strange.  I am loading an Excel file's data into an array.  I am handling things like so</p>
  
  <pre><code>foreach ($data-&gt;toArray() as $value) {
      dd($value);
      if(!empty($value)){
          foreach ($value as $v) {
              dd($v['id']);
              $insert[] = [
                  'id' =&gt; $v['id'],
                  'name' =&gt; $v['name']
              ];
          }
      }
  }
  </code></pre>
  
  <p>Now the first <code>dd()</code> (laravel output) produces something like so</p>
  
  <pre><code>array:809 [▼
    0 =&gt; array:20 [▼
      "id" =&gt; "123"
      "name" =&gt; "something"
    ]
    ...
  </code></pre>
  
  <p>So I can see there is an array element called id.  The second dd, which calls this array element, produces the output <code>123</code></p>
  
  <p>The problem comes where I am filling the array with this data.  Although I am still using <code>$v['id']</code> which works for the output, within the array I get the error</p>
  
  <blockquote>
    <p>Undefined index: id</p>
  </blockquote>
  
  <p>Why would this be the case when the index is there?</p>
  
  <p>Thanks</p>