title: How can i store data from mysql to XML in Laravel 5?
body: <p>I need data fetching from MySQL to XML and echo it in Laravel 5.</p>
  
  <p>This is how i traditionally did:</p>
  
  <pre><code>    $query = "SELECT * FROM table";
      $result = mysql_query($query);
  
      $dom = new DOMDocument("1.0");
      $parnode = $dom-&gt;appendChild($node);
  
      while ($row = @mysql_fetch_assoc($result)){
  
      $node = $dom-&gt;createElement("data");
      $newnode = $parnode-&gt;appendChild($node);
      $newnode-&gt;setAttribute("username",$row['username']);
      $newnode-&gt;setAttribute("login_attemp", $row['login_attemp']);
      $newnode-&gt;setAttribute("mobile", $row['mobile']);
      $newnode-&gt;setAttribute("email", $row['email']);
      $newnode-&gt;setAttribute("type", $row['type']);
      }
  
      echo $dom-&gt;saveXML();
  </code></pre>
  
  <p>Now, i want the same to be done in Laravel 5, Please help me</p>
  
  <p>Thanks in advance</p>