title: How to export child array element to excel in Laravel
body: <p>I'm building an application in <code>Laravel 5.5</code>, with <code>matwebsite/excel</code> plugin where I'm having an array element to be exported into csv file. I'm able to get the values when I assign single string to key inside an array, but currently I have child array element which is present into the array, which is giving me blank excel sheet once included the same.</p>
  
  <p>Without array elements:</p>
  
  <pre><code>public function investor(Request $request)
  {
      $record_set = [];
      $tables = json_decode($request-&gt;investorTable);
      foreach($tables  as $table)
      {
          $record_set[] = array(
              'schedule' =&gt; $table-&gt;schedule,
              'Event type' =&gt; $table-&gt;event_type,
              'Venue' =&gt; $table-&gt;venue,
              'Nature' =&gt; $table-&gt;nature,
          );
      }
  
      return Excel::create('investor', function($excel) use ($record_set) {
          $excel-&gt;sheet('mySheet', function($sheet) use ($record_set) {
              $sheet-&gt;fromArray($record_set);
          });
      })-&gt;download('csv');
  }
  </code></pre>
  
  <p>this is working perfect but I want to place an array element whose <code>name</code> key I want to export, I don't know how to implement when I implement it it gives me blank sheet,</p>
  
  <pre><code>$record_set[] = array(
      'schedule' =&gt; $table-&gt;schedule,
      'Company Name' =&gt; $table-&gt;companyName,
      'Contact Person' =&gt; $table-&gt;contact_participants,
      'Event type' =&gt; $table-&gt;event_type,
      'Venue' =&gt; $table-&gt;venue,
      'Nature' =&gt; $table-&gt;nature,
  );
  </code></pre>
  
  <p>my complete array element is something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ZHc18.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZHc18.png" alt="export data set"></a></p>
  
  <p>and the table looks into my html something like this:</p>
  
  <p><a href="https://i.stack.imgur.com/A02dj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A02dj.png" alt="tables"></a></p>
  
  <p>I want exactly same output in excel, help me out with this.</p>
  
  <p>Thanks.</p>