Parse XML file within laravel
<p>I want to select a XML file from my computer to be parsed. The form works and I can use the Input::file('file'); function. However I want to parse this document by favour with uploading it only as temporary file. When I want to parse it I get errors like: "unable to parse from string". It seems that parser can't find the file. I tried two parsers: SimpleXML and XMLParser(from orchestral).</p>

<pre><code>public function uploadFile(Request $ file){
$data =Input::file('file');
$informationdata = array('file' =&gt; $data);
$rules = array(
    'file' =&gt; 'required|mimes:xml|Max:10000000',
    );
    $validator=  Validator::make($informationdata, $rules);
    if($validator-&gt;fails()){
        echo 'the file has not the correct extension';
    } else{
        XmlParser::load($data-&gt;getRealPath());
    }
</code></pre>

<p>I also tried to parse it after storing the file.</p>

<pre><code>private function store($data){
    $destinationPath = public_path('uploads\\');
    $fileName = $data-&gt;getClientOriginalName();
    $data-&gt;move($destinationPath,$fileName);
    $xml = simplexml_load_file($destinationPath.$fileName);
    }
</code></pre>

<p>Thanks in advance for helping.</p>