Issues importing XML with Laravel Package orchestral/parser Issues importing XML with Laravel Package orchestral/parser laravel laravel

Issues importing XML with Laravel Package orchestral/parser


What I did in the end was:

$xml = XmlParser::load('https://www.url/feed.xml');$products = $xml->getContent();foreach($products as $product) {$item->title = $product['title'];$item->save();}


You can try "simplexml_load_string()" on Laravel.

When you use this function to parser xml file, you don't need to include other plugin on your Laravel project.

Reference : http://www.w3schools.com/php/func_simplexml_load_string.asp

For example :

$test_strting="<posts>                   <post>                       <title>Title1</title>                   </post>                   <post>                       <title>Title2</title>                   </post>               </posts>";$xml = simplexml_load_string($test_strting);foreach ($xmltest->post as $key => $value) {    $title = (string) $value->title;    echo("Titleļ¼š ".$title);}