I'm using this http://ift.tt/1JawdLr
to output XML, but it's not actually valid XML output.
$xml = DB::table("news")->select(['id', 'title', 'content', 'date_posted', 'author'])->orderBy("date_posted", "asc")->get();
$formatter = Formatter::make($xml, Formatter::XML);
$output = $formatter->toXml();
return response($output, 200)
->header('Content-Type', 'text/xml');
So how can I output valid XML in Laravel 5?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2s1Vkk2
via IFTTT
Aucun commentaire:
Enregistrer un commentaire