Mabloq's avatar

How Do I generate an Xml file from Mysql table

I'm trying to add a Google Maps Api to my site.

The docs(https://developers.google.com/maps/documentation/javascript/mysql-to-maps) recommend that I write the data from Mysql to an XML file then use JS to parse the xml file and display that data on the google map that I want to design.

However I don't want to do this in plain php, whats the Laracasts way to write to an xml file?

So far All I can think of is this:

public function() { $path = FileSystem::(path/to/maps.xml); $contents = Maps::all();

File::put($path,$contents);

}

would that work?

0 likes
2 replies
Mabloq's avatar

oooooo thank you! I will try this out!

Please or to participate in this conversation.