Reputation: 1344
I have a XML file with account information I need to be loaded in my user's table in my database.
I found this package for Laravel for XML parsing:
https://github.com/orchestral/parser
I came thus far that I can load my XML but now I am stuck. Here's the code:
$xml = XmlParser::load(url('/xml/DEBTORS.xml'));
dd($xml);
$user = $xml->parse([
'Name' => ['uses','Accounts.Account.Name'],
]);
$user Name returns NULL
Part of the XML for example:
<Account code="1004" status="A" type="C">
<Name>example name here</Name>
<Phone>emaple phone here</Phone>
For example I want to reach Account Code in @attributes and assign that to ID.
Any help is appreciated.
Upvotes: 1
Views: 5489