title: Object of class stdClass could not be converted to string - laravel
body: <p>I am following <a href="http://www.maatwebsite.nl/laravel-excel/docs/export" rel="noreferrer">this documentation</a></p>
  
  <p>to implement export to Excel in my laravel 4 project.</p>
  
  <p>So am trying to generate excel file from array like this:</p>
  
  <pre><code>//$results is taken with db query
  
  $data = array();
  foreach ($results as $result) {
     $result-&gt;filed1 = 'some modification';
     $result-&gt;filed2 = 'some modification2';
     $data[] = $result;
  }
  Excel::create('Filename', function($excel) use($data) {
  
  $excel-&gt;sheet('Sheetname', function($sheet) use($data) {
  
      $sheet-&gt;fromArray($data);
  
        });
  
  })-&gt;export('xls');
  </code></pre>
  
  <p>But this raises exception:</p>
  
  <pre><code>  Object of class stdClass could not be converted to string
  </code></pre>
  
  <p>What am I doing wrong ?</p>
  
  <p>UPDATE:</p>
  
  <p>Tried this:</p>
  
  <pre><code>$data = get_object_vars($data);
  </code></pre>
  
  <p>which results in:</p>
  
  <pre><code>get_object_vars() expects parameter 1 to be object, array given
  </code></pre>
  
  <p>This:</p>
  
  <pre><code>$data = (array)$data;
  </code></pre>
  
  <p>Results in the initial error.</p>