Parsing XML in laravel
<p>im trying to generate a xml but im getting a error: <code>FatalErrorException in 6955f07d83b93bb8aa89577b116866e228e0c155.php line 1 syntax error, unexpected 'version' (T_STRING).</code></p>

<p>I cant figure out what im doing wrong in my code.</p>

<p>My controller function is:</p>

<pre><code>public function feed($gallery_id){
        $products = Products::select("id","title","brand","url","path")-&gt;where("gallery_id",$gallery_id)-&gt;get();

        foreach ($products as $product) {
            $product-&gt;path = url($product-&gt;path);
        }
        return response()-&gt;view('xml.gallery', compact('products'))-&gt;header('Content-Type', 'text/xml');

    }
</code></pre>

<p>My blade (xml.gallery):</p>

<pre><code>    &lt;?xml version="1.0"?&gt;
    &lt;rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"&gt;
      &lt;channel&gt;
        &lt;title&gt;Test Store&lt;/title&gt;
        &lt;link&gt;http://domain.com&lt;/link&gt;
        &lt;description&gt;An example item from the feed&lt;/description&gt;
       @​foreach($products as $product)
          &lt;item&gt;
          &lt;g:id&gt;1&lt;/g:id&gt;
          &lt;g:title&gt;something&lt;/g:title&gt;
          &lt;g:description&gt;Solid plastic Dog Bowl in marine blue color&lt;/g:description&gt;
          &lt;g:link&gt;http://www.zara.com&lt;/g:link&gt;
          &lt;g:image

_link&gt;http://domain.com/images/photos_gallery/14788772681.png&lt;/g:image_link&gt;
      &lt;g:price&gt;12 GBP&lt;/g:price&gt;
      &lt;g:brand&gt;Nike&lt;/g:brand&gt;
       &lt;g:availability&gt;in stock&lt;/g:availability&gt;
       &lt;g:condition&gt;new&lt;/g:condition&gt;
    &lt;/item&gt;
  @​endforeach
  &lt;/channel&gt;
&lt;/rss&gt;
</code></pre>