title: Laravel how to load a view blade and use it with `DOMDocument`?
body: <p>In a case I have multiple views, and in a loop I should pass data to those view and load it, after that I need to parse the loaded view with <code>DOMDocument()</code> and write those to specific cell of excel. I have tried bellow steps, but has problem. </p>
  
  <pre><code> foreach($data as $result_row){
       $result_path = Config::get('auditConfig.result_page.'.$result_row['_type']);
       $view = View::make($result_path, array('item' =&gt; $result_row));
       $content = $view-&gt;render();
  
       $doc = new \DOMDocument();
       $doc-&gt;preserveWhiteSpace = false;
       $doc-&gt;loadHTMLFile($content);
       $table_tr = $doc-&gt;getElementsByTagName('tr');
       foreach($table_tr as $n) {
          echo $n-&gt;nodeValue;
       }
  }
  </code></pre>